[#177639] memoize to a file — Brian Buckley <briankbuckley@...>

Hello all,

14 messages 2006/02/01

[#177686] ANN: WSS4R was released — "Roland Schmitt" <Roland.Schmitt@...>

Hi everyone,

21 messages 2006/02/01

[#177712] Seeking Continuations Links — James Edward Gray II <james@...>

Myself and a few others are trying to get together a "Playing Around

12 messages 2006/02/01

[#177715] Indentation vs. "end"s — "Rubyist" <nuby.ruby.programmer@...>

Hi,

82 messages 2006/02/01
[#178134] Re: Indentation vs. "end"s — Yukihiro Matsumoto <matz@...> 2006/02/03

Hi,

[#178139] Re: Indentation vs. "end"s — Cameron McBride <cameron.mcbride@...> 2006/02/03

I'm out of my league, but...

[#177722] Re: Indentation vs. "end"s — doug00@... 2006/02/01

Yes I really like the end statements, and they make it easier for

[#177943] Re: Indentation vs. "end"s — Hal Fulton <hal9000@...> 2006/02/02

doug00@gmail.com wrote:

[#178227] Re: Indentation vs. "end"s — Michal Suchanek <hramrach@...> 2006/02/03

On 2/2/06, Hal Fulton <hal9000@hypermetrics.com> wrote:> doug00@gmail.com wrote:> > Yes I really like the end statements, and they make it easier for> > beginners. It's possible to support both indenting and end statements> > (i.e. support one mode or the other), and you don't need python's> > redundant and unnecessary colons. I implemented this myself in a> > parser. I don't think it is appropriate for ruby, however.> >> > What would be even better would be to allow optional labels after end> > statements, such as "end class", "end def", so the parser can catch> > more errors.> > I've implemented this as well in a separate project.> >>> Not a bad idea in itself. In fact, I think that really old Ruby> versions (prior to my learning it with 1.4) did something like> that. When modifiers were introduced (x if y, x while y, etc.)> parsing became difficult and they were dropped. I think that's> the case.

[#177816] neuroimage software - scientific computing and visualization — "Darren L. Weber" <darrenleeweber@...>

20 messages 2006/02/01

[#177902] Job Vacancy RoR — "stephen@..." <stephen@...>

I am part of a small Agency that supplies contractors to clients. A

15 messages 2006/02/01
[#177919] Re: Job Vacancy RoR — tsumeruby@... 2006/02/02

Please use sites like monster or dice if you wish to post jobs. Some have been

[#178072] Job postings? Please! (Was: Re: Job Vacancy RoR) — Eric Hodel <drbrain@...7.net> 2006/02/02

On Feb 1, 2006, at 5:16 PM, tsumeruby@tsumelabs.com wrote:

[#177996] Chomping and stomping — John Maclean <info@...>

Chaps,

17 messages 2006/02/02

[#178218] Splitting the Loot (#65) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

33 messages 2006/02/03

[#178265] Ruby IDEs — Chris <cpmbailey@...>

After years of programming in C++, Java et al my new job used Smalltalk

15 messages 2006/02/03

[#178298] Editor on Mac OS X — "Dan Munk" <danmunk@...>

Hello,

19 messages 2006/02/04

[#178332] Extract hash into local variables? — csn <cool_screen_name90001@...>

Is there a Ruby function similar to PHP's extract/list? What I'd like to

17 messages 2006/02/04

[#178364] Problem with weak references on OS X 10.3 — Caleb Clausen <vikkous@...>

I am having problems with weak references. The program below exhibits

10 messages 2006/02/04

[#178392] Quiz #65, Principle of Great Surprise, and Array.delete sledgehammer — Dave Howell <groups@...>

I thought I was actually going to enter my first RubyQuiz, but I've

25 messages 2006/02/04

[#178393] built-in vs. standard library — Mark Volkmann <r.mark.volkmann@...>

I'm confused about whether the Date class is built-in or in the

11 messages 2006/02/04

[#178416] Scanning a string for decimal numbers — Jeppe Jakobsen <jeppe88@...>

Hi all, how do you scan a string and avoid getting my decimal numbers

23 messages 2006/02/04

[#178579] Ruby jargon and slang — Hal Fulton <hal9000@...>

I'm assembling a list of Ruby community "usages" and I want to make

29 messages 2006/02/06

[#178658] Problems building binaries on OS X 10.4 — "Eric Promislow" <eric.promislow@...>

This is with the Ruby that ships with 10.4 (Tiger). We haven't tried

6 messages 2006/02/06

[#178710] reasons to use else inside rescue — Mark Volkmann <r.mark.volkmann@...>

I understand that the code in the else part of a begin block is only

9 messages 2006/02/07
[#178734] Re: reasons to use else inside rescue — "Robert Klemme" <bob.news@...> 2006/02/07

David Vallner wrote:

[#178752] Re: reasons to use else inside rescue — Mark Volkmann <r.mark.volkmann@...> 2006/02/07

On 2/7/06, Robert Klemme <bob.news@gmx.net> wrote:> David Vallner wrote:> > D Utorok 07 Febru疵 2006 03:33 Mark Volkmann nap﨎al:> >> I understand that the code in the else part of a begin block is only> >> executed if no exceptions are raised by code in the begin block.> >> However, the same is true of code at the end of the begin block. Why> >> not put the code there?> >>> >> For example, I believe these are equivalent.> >>> >> begin> >> do_something> >> rescue> >> handle_exception> >> else> >> do_more_stuff> >> end> >>> >> begin> >> do_something> >> do_more_stuff> >> rescue> >> handle_exception> >> end> >>> >> I suppose a difference is that if "do_more_stuff" raises an> >> exception, the first example can't rescue it and the second might.> >> Is that the only difference?> >>> >> --> >> R. Mark Volkmann> >> Partner, Object Computing, Inc.> >> > There's an else part in a begin / end block?! Oh dear. Heavens> > protect us...>> Why?>> > It seems pretty equivalent to plain old:> >> > begin> > do_something> > rescue> > handle_exception> > end> > do_more_stuff> >> > Do we have a syntax guru to elaborate on this?>> Although not being a syntax guru, the idiom you presented is definitely> *not* equivalent. do_more_stuff will also be called if an exception was> caught and not reraised while code in the "else" branch is only invoked if> there was no exception raised.>> > That said, my wild guess would be that in the code fragment> > (apologies for using different method names):> >> > begin> > foo> > rescue> > bar> > else> > baz> > finally>> "finally" is Java - you probably meant "ensure".>> > quux> > end> >> > (*sic* - messiest code excerpt ever)> >> > if #foo didn't raise an Exception, the order of executions would be> > #foo, #baz, and then #quux. That is, unless the else is nothing more> > than no-op syntactic sugar for just putting the statements after a> > begin / rescue / finally block.>> As Mark said, a *rough* equivalent is to put code in the else part> directly before the first rescue. But they do not have the same> semantics! The difference is that all exceptions raised between "begin"> and "rescue" are potentially subject to exception handling on one of the> "rescue" branches. This is not true for code in the "else" branch.>> Another reason to put code into the else branch is documentation. It's> visibly clear that this code does not belong to the main functionality of> the begin end block but that it's intended to act on successfull execution> of the block.

[#178784] Ruby in Browsers? — petermichaux@...

Hi,

15 messages 2006/02/07
[#178787] Re: Ruby in Browsers? — Gregory Seidman <gsslist+ruby@...> 2006/02/07

On Wed, Feb 08, 2006 at 12:58:26AM +0900, petermichaux@yahoo.com wrote:

[#178808] Start from the start - Ruby or ruby on rails — eain.jones@...

I'm looking to start developing a simple task management application

23 messages 2006/02/07
[#178813] Re: Start from the start - Ruby or ruby on rails — Daniel Nugent <nugend@...> 2006/02/07

I'd say your best bet would be to start with a couple of Ruby

[#178816] Re: Start from the start - Ruby or ruby on rails — Jules Jacobs <devlists-ruby-talk@...> 2006/02/07

I think you meant this one:

[#178854] Re: Start from the start - Ruby or ruby on rails — "Konrad Roziewski" <kroziewski@...> 2006/02/07

I completely agree with Jules: try Rails from the start and learn Ruby

[#178909] Re: Start from the start - Ruby or ruby on rails — eain.jones@... 2006/02/08

Thanks to everybody for the recommendations. I had a lot of the links

[#178965] Re: Start from the start - Ruby or ruby on rails — James Edward Gray II <james@...> 2006/02/08

On Feb 8, 2006, at 3:53 AM, eain.jones@gmail.com wrote:

[#178999] Re: Start from the start - Ruby or ruby on rails — "Seth Thomas Rasmussen" <sethrasmussen@...> 2006/02/08

Hi James,

[#179022] Re: Start from the start - Ruby or ruby on rails — eain.jones@... 2006/02/08

James and Seth,

[#178863] Meta-Meta-Programming — Erik Veenstra <pan@...>

30 messages 2006/02/07

[#178942] boolean annoyance — Claudio Jeker <cjeker@...>

Hello,

28 messages 2006/02/08
[#178949] Re: boolean annoyance — Matthew Moss <matthew.moss.coder@...> 2006/02/08

> there is one thing in ruby that annoys me most (at least for now).

[#179039] Re: boolean annoyance — Claudio Jeker <cjeker@...> 2006/02/08

On Thu, Feb 09, 2006 at 01:16:26AM +0900, Matthew Moss wrote:

[#179063] Re: boolean annoyance — Austin Ziegler <halostatue@...> 2006/02/09

On 08/02/06, Claudio Jeker <cjeker@diehard.n-r-g.com> wrote:

[#179071] Re: boolean annoyance — Claudio Jeker <cjeker@...> 2006/02/09

On Thu, Feb 09, 2006 at 09:15:54AM +0900, Austin Ziegler wrote:

[#180105] Re: boolean annoyance — Austin Ziegler <halostatue@...> 2006/02/16

On 2/8/06, Claudio Jeker <cjeker@diehard.n-r-g.com> wrote:> On Thu, Feb 09, 2006 at 09:15:54AM +0900, Austin Ziegler wrote:> > On 08/02/06, Claudio Jeker <cjeker@diehard.n-r-g.com> wrote:> > >> It's actually the most illogic part of languages like C that treat 0> > >> as false. Believe me, having spent most of my programming life using> > >> C/C++ and being used to that, I make mistakes regularly whilst writing> > >> Ruby code.> > >>> > >> 0 is an integer and quite often a valid value. C's treatment of 0 as> > >> false is convenient in some situations but horribly inconvenient in> > >> others. Because if I'm expecting an integer and zero is a legal> > >> value, then you have to start playing around in your conditionals...> > >> "Okay, today any -1 is false"... or even at different levels than> > >> that. Part of the problem is that C doesn't have an actual NULL...> > >> NULL is just defined as zero. Overlap, explosions, crash and burn...> > > If you are inspecting a integer against nothing end everything is just> > > legal, why are you inspecting it?> >> > Sorry, but that doesn't work. If you have something that returns an> > integer value -- consider strtol(3). This can return *any* valid integer> > value, but if you get a 0, LONG_MAX, or LONG_MIN, you have to *then*> > check errno to see if the conversion was, in fact, successful. (And the> > conversion could be unsuccessful for any number of reasons.)> This is not correct. strtol(3) does not return 0 in case of an error. It> sets errno to ERANGE and returns LONG_MAX or LONG_MIN.

[#178975] Sandboxing eval'd code — eastcoastcoder@...

I'm working on a web app with complicated and ever changing business

19 messages 2006/02/08

[#179035] Geocoder 0.1.0 — Paul Smith <paul@...>

Geocoder is a library for Ruby developers and a command-line utility

13 messages 2006/02/08

[#179121] Ruby on AIX? — Obie Fernandez <obiefernandez@...>

We're looking at big IBM hardware running AIX as a potential

11 messages 2006/02/09

[#179125] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — Nuralanur@...

Dear Glenn,

15 messages 2006/02/09
[#179138] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — David Vallner <david@...> 2006/02/09

Dňa Štvrtok 09 Február 2006 10:32 Nuralanur@aol.com napísal:

[#179154] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — tsumeruby@... 2006/02/09

> I believe Glenn called for something that lets him do desktop applets, not

[#179162] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — david@... 2006/02/09

Quoting tsumeruby@tsumelabs.com:

[#179168] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — tsumeruby@... 2006/02/09

On Friday 10 February 2006 01:59 am, david@vallner.net wrote:

[#179184] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — David Vallner <david@...> 2006/02/09

I had a look at Tile, and it looks promising too. But I tried doing some

[#179216] Re: Yahoo! Widgets (JavaScript) - do we have a anything like this? — tsumeruby@... 2006/02/09

On Friday 10 February 2006 04:54 am, David Vallner wrote:

[#179262] FasterGenerator (#66) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

52 messages 2006/02/10
[#179276] Re: [QUIZ] FasterGenerator (#66) — Matthew Moss <matthew.moss.coder@...> 2006/02/10

Not being familiar with all the various Ruby packages and libs, I

[#179702] Re: [QUIZ] FasterGenerator (#66) — James Edward Gray II <james@...> 2006/02/13

On Feb 10, 2006, at 7:53 AM, Ruby Quiz wrote:

[#179340] why would i want to put my mysql password in the yml file? — trevor <trevor@...>

hello - i'm new!

19 messages 2006/02/11

[#179351] Private methods - only available to oneself? — "minkoo.seo@..." <minkoo.seo@...>

Hi, all.

44 messages 2006/02/11
[#179382] Re: Private methods - only available to oneself? — "Minkoo Seo" <minkoo.seo@...> 2006/02/11

I'm sorry Erik. I'm not native English speaker. So, sometimes it's not

[#179385] Re: Private methods - only available to oneself? — "Erik Veenstra" <google@...> 2006/02/11

> I'm sorry Erik. I'm not native English speaker. So, sometimes

[#179395] Re: Private methods - only available to oneself? — "Phrogz" <gavin@...> 2006/02/11

I think the purpose of instance_eval is one of those "sharp knife"

[#179742] Re: Private methods - only available to oneself? — "Adam P. Jenkins" <thorin@...> 2006/02/13

Phrogz wrote:

[#179366] OpenStruct problem — "Minkoo Seo" <minkoo.seo@...>

OpenStruct class seems to be misbehave when it comes to hashing.

12 messages 2006/02/11

[#179434] Quickly before all is lost! — Alex Combas <alex.combas@...>

ZOMG! Ruby RSS feeds growing exponentially!

15 messages 2006/02/11

[#179447] Rake Friday? — Bil Kleb <Bil.Kleb@...>

Is there a Friday,

23 messages 2006/02/12

[#179503] Cutting a piece of text — Zdebel <szczupienczyk@...>

Helo !

14 messages 2006/02/12

[#179520] Rescuing blocks? — Daniel Nugent <nugend@...>

Hey guys,

26 messages 2006/02/12
[#179523] Re: Rescuing blocks? — David Vallner <david@...> 2006/02/12

Dňa Nedeľa 12 Február 2006 19:26 Daniel Nugent napísal:

[#179524] Re: Rescuing blocks? — Daniel Nugent <nugend@...> 2006/02/12

Whoops, shoulda thought of that, a-doy.

[#179528] Re: Rescuing blocks? — Lou Vanek <vanek@...> 2006/02/12

this works,

[#179531] Re: Rescuing blocks? — Mark Volkmann <r.mark.volkmann@...> 2006/02/12

On 2/12/06, Lou Vanek <vanek@acd.net> wrote:

[#179532] Struct creates non-standard classes — Mark Volkmann <r.mark.volkmann@...>

If Struct is a shorthand way for creating Classes, why don't objects

12 messages 2006/02/12
[#179536] Re: Struct creates non-standard classes — David Vallner <david@...> 2006/02/12

Dňa Nedeľa 12 Február 2006 20:45 Mark Volkmann napísal:

[#179543] Re: Struct creates non-standard classes — Mark Volkmann <r.mark.volkmann@...> 2006/02/12

On 2/12/06, David Vallner <david@vallner.net> wrote:> D Nedeオa 12 Febru疵 2006 20:45 Mark Volkmann nap﨎al:> > If Struct is a shorthand way for creating Classes, why don't objects> > created from those Classes have instance_variables?> >>> My guess is because Struct directly accesses a C hashtable, instead of> registering instance variables in the interpreter. Not like it should matter> unless you for some reason with to access the variables with reflection> instead of the accessors, which I can't imagine why you'd want to do.

[#179554] Re: Struct creates non-standard classes — Robert Klemme <shortcutter@...> 2006/02/12

2006/2/12, Mark Volkmann <r.mark.volkmann@gmail.com>:> On 2/12/06, David Vallner <david@vallner.net> wrote:> > D Nedeオa 12 Febru疵 2006 20:45 Mark Volkmann nap﨎al:> > > If Struct is a shorthand way for creating Classes, why don't objects> > > created from those Classes have instance_variables?

[#179546] Mongrel 0.3.1 -- New Site/Runs Right — Zed Shaw <zedshaw@...>

Hello All,

25 messages 2006/02/12

[#179596] couple quick questions about YARV — Joshua Haberman <joshua@...>

I know YARV is far from finished, but:

11 messages 2006/02/12

[#179623] tree structures — "frank" <mjzanis@...>

Hi,

15 messages 2006/02/13

[#179741] ruby html (or xhtml) forms class... — "Skeets" <skillet3232@...>

does one exist? i use an excellent php based forms class when i code

16 messages 2006/02/13

[#179790] Mongrel 0.3.2 -- The Right Site/All Requests Answered — Zed Shaw <zedshaw@...>

"Another Mongrel release?! Is he insane?" Yeah, basically.

4 messages 2006/02/14
[#179798] Re: [ANN] Mongrel 0.3.2 -- The Right Site/All Requests Answered — Aaron Kulbe <akulbe@...> 2006/02/14

On 2/13/06, Zed Shaw <zedshaw@zedshaw.com> wrote:> "Another Mongrel release?! Is he insane?" Yeah, basically.>> This is yet another release of Mongrel that adds a bunch of little features> people requested and I found were needed. This release is almost entirely> targeted at Ruby on Rails folks as the majority of the changes went into the> mongrel_rails runner.>> Get this release from the (correctly linked) site:>> * http://mongrel.rubyforge.org/ -- project site.> * http://rubyforge.org/frs/?group_id=1306 -- direct to downloads.>>> == What's Mongrel>> Mongrel is a fast HTTP library and server for Ruby that is intended for> hosting Ruby web applications of any kind using plain HTTP rather than> FastCGI or SCGI. It is framework agnostic and already supports Ruby On> Rails, Og+Nitro, and Camping frameworks.>>> == Getting Mongrel>> Simplest way to get Mongrel is through RubyGems. If you've got Ruby On> Rails floating around you just do this:>> $ gem install mongrel (or gem upgrade if you've already got it)> $ cd myrailsapp> $ mongrel_rails start -d>> That runs it in the background in *development* mode on port 3000. Use the> -h option to start to see the various options you have. Stopping it is> just:>> $ mongrel_rails stop>> Win32 people will need to avoid -d until I can test things an get a service> written.>> == Changes>> Lots of little fixes and enhancements that people requested from the last> release.>> * FAQ questions answered on threading and deployment scenarios.> * Added some additional text to make the side icons a little clearer.> * Created a dogs page with some people's favorite pets.> * Write out a better message for 'mongrel_rails start' giving the> environment and other stuff.> * Default to using ENV['RAILS_ENV'] or "default" as environment.> * Removed the restriction on the environments so people can have custom> ones.> * Added options for:> * -n Number of processor threads.> * -t Timeout for each processor before it kills a request.> * -m Specify additional MIME type mappings in YAML format.> * -c Change to directory before starting (both for start and stop> commands)> * -r Use a different document root from "public"> * Use "rb" as open mode on all platforms (for windows binary files)> * Fixed bug in DirHandler which prevented people from altering MIME mapping.>> The big change is the additional options that people have for running Ruby> On Rails applications via Mongrel. Please try them out with your weird> configurations and let me know how they work.>> == Dogs>> Don't forget to check out peoples favorite pets at> http://mongrel.rubyforge.org/dogs.html>> Zed A. Shaw> http://www.zedshaw.com/>>>

[#179860] How to run a Ruby file without installing Ruby? — "Rubyist" <nuby.ruby.programmer@...>

Let's suppose that I wrote a Ruby program which is incredibly

17 messages 2006/02/14

[#179978] gem/rdoc/ri errors on mingw — Alex Combas <alex.combas@...>

Hello,yesterday I switched from the very good, perfectly functionalone-click installer to a build-it-yourself-ruby-compile on winXPwith the mingw environment.

8 messages 2006/02/15

[#180000] Getting Started — lists@...

Hi, I'm trying to get started with Ruby, but I don't feel that any of

14 messages 2006/02/15

[#180012] Possible Ruby-centric NASA SBIR area — Bil Kleb <Bil.Kleb@...>

I've been asked to write a small topic area

20 messages 2006/02/15

[#180021] Ruby script to Module/Class refactor — "James B. Byrne" <ByrneJB@...>

I have written my first live ruby script that actually performs useful

14 messages 2006/02/15

[#180046] OT: Is this worth a try? — "gregarican" <greg.kujawa@...>

I am trying out some other scripting languages and wanted to give

26 messages 2006/02/15
[#180063] Re: OT: Is this worth a try? — David Vallner <david@...> 2006/02/15

Dňa Streda 15 Február 2006 20:33 gregarican napísal:

[#180080] Eating CPAN - Was Port A Library. — John Carter <john.carter@...>

CPAN has 9502 modules.

13 messages 2006/02/16

[#180202] recontextualizing a block (looking for deep magic) — ptkwt@... (Phil Tomson)

What I'm trying to do probably isn't possible, but maybe someone knows some

18 messages 2006/02/16

[#180204] Rubuntu LiveCD I need vim/emacs configs! — Ezra Zygmuntowicz <ezmobius@...>

Friends-

32 messages 2006/02/16
[#182082] Re: Rubuntu LiveCD I need vim/emacs configs! — "Joe" <joesavona@...> 2006/03/01

Just a thought - what about creating a VMware player appliance with all

[#185813] Re: Rubuntu LiveCD I need vim/emacs configs! — "Brandon Hines" <brandonhines@...> 2006/03/25

This topic has been dead for a few days...how's the project coming?

[#185901] Re: Rubuntu LiveCD I need vim/emacs configs! — "ezmobius mob" <ezmobius@...> 2006/03/25

On 3/24/06, Brandon Hines <brandonhines@gmail.com> wrote:

[#180213] Don't let this happen to Ruby, pleeeeease? — Glenn Smith <glenn.ruby@...>

This is quite a good article I just read via a link on artima (I think).

26 messages 2006/02/16
[#180216] Re: Don't let this happen to Ruby, pleeeeease? — James Britt <james_b@...> 2006/02/16

Glenn Smith wrote:

[#180471] Re: Don't let this happen to Ruby, pleeeeease? — "Glenn Smith" <glenn.ruby@...> 2006/02/18

Sorry, posted my rant, then disappeared for two days!

[#180556] Re: Don't let this happen to Ruby, pleeeeease? — David Vallner <david@...> 2006/02/19

Dňa Sobota 18 Február 2006 21:48 Glenn Smith napísal:

[#180566] Re: Don't let this happen to Ruby, pleeeeease? — "Glenn Smith" <glenn.ruby@...> 2006/02/19

If I represent half of Ruby's users (other Windows users comfortably under

[#180280] metakoans.rb (#67) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

80 messages 2006/02/17
[#180334] Re: [QUIZ] metakoans.rb (#67) — "Patrick Hurley" <phurley@...> 2006/02/17

On 2/17/06, Ruby Quiz <james@grayproductions.net> wrote:

[#180335] Re: [QUIZ] metakoans.rb (#67) — ara.t.howard@... 2006/02/17

On Sat, 18 Feb 2006, Patrick Hurley wrote:

[#180337] Re: [QUIZ] metakoans.rb (#67) — "Patrick Hurley" <phurley@...> 2006/02/17

On 2/17/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#180338] Re: [QUIZ] metakoans.rb (#67) — ara.t.howard@... 2006/02/17

On Sat, 18 Feb 2006, Patrick Hurley wrote:

[#180341] Re: [QUIZ] metakoans.rb (#67) — "Wilson Bilkovich" <wilsonb@...> 2006/02/18

On 2/17/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#180345] Re: [QUIZ] metakoans.rb (#67) — "Jacob Fugal" <lukfugl@...> 2006/02/18

On 2/17/06, Wilson Bilkovich <wilsonb@gmail.com> wrote:

[#180346] Re: [QUIZ] metakoans.rb (#67) — "Wilson Bilkovich" <wilsonb@...> 2006/02/18

On 2/17/06, Jacob Fugal <lukfugl@gmail.com> wrote:

[#180352] Re: [QUIZ] metakoans.rb (#67) — ara.t.howard@... 2006/02/18

On Sat, 18 Feb 2006, Wilson Bilkovich wrote:

[#180355] Re: [QUIZ] metakoans.rb (#67) — "Wilson Bilkovich" <wilsonb@...> 2006/02/18

On 2/17/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#180393] Re: [QUIZ] metakoans.rb (#67) — Sylvain Joyeux <sylvain.joyeux@...> 2006/02/18

I'm at 13

[#180404] Re: [QUIZ] metakoans.rb (#67) — "Patrick Hurley" <phurley@...> 2006/02/18

I also have 13; however, two lines exceed 80 columns. Additionally, I

[#180284] Re: Python for Fortran Programmers — Stephan Mueller <d454d@...>

* Bil Kleb <Bil.Kleb@NASA.gov> [060217 11:32]:

13 messages 2006/02/17
[#180285] Re: Python for Fortran Programmers — ara.t.howard@... 2006/02/17

On Sat, 18 Feb 2006, Stephan Mueller wrote:

[#180358] Ruby scripts as Win32-Service — "William Ramirez" <mercan01@...>

I've through together a ruby script as test for a monitoring app for a few

10 messages 2006/02/18
[#180360] Re: Ruby scripts as Win32-Service — "Patrick Hurley" <phurley@...> 2006/02/18

On 2/17/06, William Ramirez <mercan01@gmail.com> wrote:

[#180362] Desktop apps written in Ruby? — petermichaux@...

Hi,

18 messages 2006/02/18
[#180365] Re: Desktop apps written in Ruby? — "Wilson Bilkovich" <wilsonb@...> 2006/02/18

On 2/17/06, petermichaux@yahoo.com <petermichaux@yahoo.com> wrote:

[#180370] Re: Desktop apps written in Ruby? — petermichaux@... 2006/02/18

Thanks for the reply. From that QTRuby link "to create cross-platform

[#180373] Re: Desktop apps written in Ruby? — tsumeruby@... 2006/02/18

On Saturday 18 February 2006 01:08 pm, petermichaux@yahoo.com wrote:

[#180375] Re: Desktop apps written in Ruby? — Scott Weeks <weeksie@...> 2006/02/18

Why not just build the front end of the app in a windows language

[#180378] Re: Desktop apps written in Ruby? — tsumeruby@... 2006/02/18

On Saturday 18 February 2006 02:21 pm, Scott Weeks wrote:

[#180430] best way to use (exploit) mailing list. — John Maclean <info@...>

hey Chaps,

10 messages 2006/02/18

[#180487] maximum number of module methods? — Suraj Kurapati <skurapat@...>

-----BEGIN PGP SIGNED MESSAGE-----

12 messages 2006/02/18

[#180506] lazy.rb 0.9.5 -- transparent futures! — MenTaLguY <mental@...>

I'd like to announce a new version of lazy.rb -- this one offering

43 messages 2006/02/19
[#180853] Re: [ANN] lazy.rb 0.9.5 -- transparent futures! — Andrew Johnson <ajohnson@...> 2006/02/21

On Sun, 19 Feb 2006 10:07:12 +0900, MenTaLguY <mental@rydia.net> wrote:

[#180945] Re: [ANN] lazy.rb 0.9.5 -- transparent futures! — MenTaLguY <mental@...> 2006/02/21

On Tue, 2006-02-21 at 17:33 +0900, Andrew Johnson wrote:

[#180993] Re: lazy.rb 0.9.5 -- transparent futures! — Jim Weirich <jim@...> 2006/02/21

MenTaLguY wrote:

[#180997] Re: lazy.rb 0.9.5 -- transparent futures! — MenTaLguY <mental@...> 2006/02/21

On Wed, 2006-02-22 at 06:49 +0900, Jim Weirich wrote:

[#181023] Re: lazy.rb 0.9.5 -- transparent futures! — Jim Weirich <jim@...> 2006/02/22

MenTaLguY wrote:

[#180698] How can I search value from xml — "Artit Satanakulpanich" <rubybox@...>

How can i search value from xml file such as I want to find from *pubdate *and

15 messages 2006/02/20

[#180709] dirty ranges — dvandeun@... (Dirk van Deun)

I'm a new Ruby user (currently at page 68 of Programming Ruby !) and

12 messages 2006/02/20

[#180811] ANN: Second drop of RubyCLR bridge — "John Lam" <drjflam@...>

This is a much more complete drop of the bridge:

10 messages 2006/02/21

[#180889] Blocks / Closures — Picklegnome <picklegnome@...>

I've just been looking into Ruby in the last few days, and I must say it

14 messages 2006/02/21

[#181027] rubynuby - client side Ruby? — Jeff Pritchard <jp@...>

I would like to be able to do client-side scripting things that in the

19 messages 2006/02/22

[#181181] Mr. Guid 0.2 (Cross-platform Ruby GUI Debugger) — "mitchell" <ffsnoopy@...>

Mr. Guid 0.2 is a milestone release because it can now be run on both

22 messages 2006/02/23

[#181210] compiling c program using rb_eval_string() — hongseok.yoon@...

I tried to call rb_eval_string(), so I wrote simple C code.

6 messages 2006/02/23
[#181213] Re: compiling c program using rb_eval_string() — "Gyoung-Yoon Noh" <nohmad@...> 2006/02/23

On 2/23/06, hongseok.yoon@gmail.com <hongseok.yoon@gmail.com> wrote:> I tried to call rb_eval_string(), so I wrote simple C code.>> #include "/home/xopht/lib/1.8/i686-linux/ruby.h">> int main()> {> rb_eval_string( "puts" );> return 0;> }>> I compiled it and get bellow result.>> [xopht@odin ruby]$ g++ -o test test.cc -lruby-static -L/home/xopht/lib/> /home/xopht/lib//libruby-static.a(string.o)(.text+0x319a): In function> `rb_str_crypt':> /home/xopht/ruby/ruby-1.8.4/string.c:4360: undefined reference to> `crypt'> /home/xopht/lib//libruby-static.a(dln.o)(.text+0x9f): In function> `dln_load':> /home/xopht/ruby/ruby-1.8.4/dln.c:1351: undefined reference to `dlopen'> /home/xopht/lib//libruby-static.a(dln.o)(.text+0xb6):/home/xopht/ruby/ruby-1.8.4/dln.c:1356:> undefined reference to `dlsym'> /home/xopht/lib//libruby-static.a(dln.o)(.text+0x12b):/home/xopht/ruby/ruby-1.8.4/dln.c:1359:> undefined reference to `dlclose'> /home/xopht/lib//libruby-static.a(dln.o)(.text+0x5): In function> `dln_strerror':> /home/xopht/ruby/ruby-1.8.4/dln.c:1193: undefined reference to> `dlerror'> collect2: ld returned 1 exit status> [xopht@odin ruby]$>> what's wrong?>>>

[#181215] Re: compiling c program using rb_eval_string() — "Gyoung-Yoon Noh" <nohmad@...> 2006/02/23

On 2/23/06, Gyoung-Yoon Noh <nohmad@gmail.com> wrote:> On 2/23/06, hongseok.yoon@gmail.com <hongseok.yoon@gmail.com> wrote:> > I tried to call rb_eval_string(), so I wrote simple C code.> >> > #include "/home/xopht/lib/1.8/i686-linux/ruby.h"> >> > int main()> > {> > rb_eval_string( "puts" );> > return 0;> > }> >> > I compiled it and get bellow result.> >> > [xopht@odin ruby]$ g++ -o test test.cc -lruby-static -L/home/xopht/lib/> > /home/xopht/lib//libruby-static.a(string.o)(.text+0x319a): In function> > `rb_str_crypt':> > /home/xopht/ruby/ruby-1.8.4/string.c:4360: undefined reference to> > `crypt'> > /home/xopht/lib//libruby-static.a(dln.o)(.text+0x9f): In function> > `dln_load':> > /home/xopht/ruby/ruby-1.8.4/dln.c:1351: undefined reference to `dlopen'> > /home/xopht/lib//libruby-static.a(dln.o)(.text+0xb6):/home/xopht/ruby/ruby-1.8.4/dln.c:1356:> > undefined reference to `dlsym'> > /home/xopht/lib//libruby-static.a(dln.o)(.text+0x12b):/home/xopht/ruby/ruby-1.8.4/dln.c:1359:> > undefined reference to `dlclose'> > /home/xopht/lib//libruby-static.a(dln.o)(.text+0x5): In function> > `dln_strerror':> > /home/xopht/ruby/ruby-1.8.4/dln.c:1193: undefined reference to> > `dlerror'> > collect2: ld returned 1 exit status> > [xopht@odin ruby]$> >> > what's wrong?> >> >> >>> rb_string_eval() needs to be initialized properly.> Check this,> http://phrogz.net/ProgrammingRuby/ext_ruby.html#extendingruby> http://www.rubygarden.org/ruby?EmbedRuby>> --> http://nohmad.sub-port.net>

[#181224] Ruby as First Language — "woodyee" <wood_yee12@...>

Hi! I'm interested in getting opinions on Ruby as a first language. For

55 messages 2006/02/23
[#181479] Re: Ruby as First Language — "Timothy Goddard" <interfecus@...> 2006/02/24

My order was Quick BASIC, then C++, PHP, then Ruby. I found the

[#181520] Re: Ruby as First Language — Gregory Seidman <gsslist+ruby@...> 2006/02/25

On Sat, Feb 25, 2006 at 08:13:34AM +0900, Timothy Goddard wrote:

[#181526] Re: Ruby as First Language — "Chris Pine" <chris@...> 2006/02/25

On 2/25/06, Gregory Seidman <gsslist+ruby@anthropohedron.net> wrote:> 1) Logo as a preteen, or AWK and/or Bourne shell scripting at any age> 2) C (second procedural language)> 3) Ruby, Python, Java, or C# (first OOP language)

[#181261] Creating Ruby Classes from XSD? — "Justin Bailey" <jgbailey@...>

.NET ships with a tool that will generate classes directly from an XML

15 messages 2006/02/23

[#181291] LibXML-Ruby 0.3.6 — Ross Bamford <rossrt@...>

LibXML-Ruby 0.3.6 is now available from Rubyforge. LibXML-Ruby is (as

29 messages 2006/02/23

[#181315] Huge performance gap — Alexis Reigel <mail@...>

Hi all

79 messages 2006/02/23
[#181318] Re: Huge performance gap — "E. Saynatkari" <none@...> 2006/02/23

Alexis Reigel wrote:

[#199810] Re: Huge performance gap — Reggie Mr <buppcpp@...> 2006/07/01

Here is a simple graph of performance by different platforms.

[#199814] Re: Huge performance gap — "Austin Ziegler" <halostatue@...> 2006/07/01

On 7/1/06, Reggie Mr <buppcpp@yahoo.com> wrote:

[#199841] Re: Huge performance gap — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/01

Austin Ziegler wrote:

[#199864] Re: Huge performance gap — "Robert Klemme" <shortcutter@...> 2006/07/01

2006/7/1, M. Edward (Ed) Borasky <znmeb@cesmail.net>:

[#199885] Re: Huge performance gap — Reggie Mr <buppcpp@...> 2006/07/02

Austin Ziegler wrote:

[#199889] Re: Huge performance gap — Daniel DeLorme <dan-ml@...42.com> 2006/07/02

Reggie Mr wrote:

[#199890] Re: Huge performance gap — "Francis Cianfrocca" <garbagecat10@...> 2006/07/02

>

[#199915] Ruby and Rails performance profiling? — Robert Mela <rmela@...> 2006/07/02

What tools exist for profiling Ruby?

[#199916] Re: Ruby and Rails performance profiling? — "Francis Cianfrocca" <garbagecat10@...> 2006/07/02

Ruby has a built-in profiler. Fair enough, let's run it, it would be

[#199931] Re: Ruby and Rails performance profiling? — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/02

Francis Cianfrocca wrote:

[#181316] Fwd: Launching Ruby scripts and the future of MVM — "Charles O Nutter" <headius@...>

I tossed this message off to the Ruby-core list about a month ago, and

11 messages 2006/02/23
[#181325] Re: Launching Ruby scripts and the future of MVM — gwtmp01@... 2006/02/23

[#181343] Re: Launching Ruby scripts and the future of MVM — Logan Capaldo <logancapaldo@...> 2006/02/23

[#181377] Re: Launching Ruby scripts and the future of MVM — gwtmp01@... 2006/02/24

[#181379] Re: Launching Ruby scripts and the future of MVM — "Austin Ziegler" <halostatue@...> 2006/02/24

On 2/23/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:> On Feb 23, 2006, at 6:20 PM, Logan Capaldo wrote:>> On Feb 23, 2006, at 5:42 PM, gwtmp01@mac.com wrote:>>> On Feb 23, 2006, at 5:05 PM, Charles O Nutter wrote:>>>> I tossed this message off to the Ruby-core list about a month ago,>>>> and sent a follow-up email today. The basic idea is that if there>>>> were a Kernel#run_script method or similar, all Ruby apps that want>>>> to launch external scripts could do so in a platform and>>>> implementation-independent way.>>> In what way is what you are proposing different from Kernel#system?>> system(x) # x is arbitrary shell command>> run_script(x) # x is guaranteed to be a script written in ruby>>>> This means for instance, that run_script could get away with not>> forking a new process, but rather just a new ruby VM assuming that>> the ruby implementation had that capability> You already have coroutines, threads, fork/exec, system, and load/> require all of which give you different ways to manage multiple> threads of control and/or interpret external ruby code.

[#181420] Current Temperature (#68) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

25 messages 2006/02/24

[#181542] FasterCSV 0.1.6 -- With Header Support! — James Edward Gray II <james@...>

FasterCSV 0.1.6 Released

25 messages 2006/02/26
[#181543] Re: [ANN] FasterCSV 0.1.6 -- With Header Support! — "Gregory Brown" <gregory.t.brown@...> 2006/02/26

On 2/25/06, James Edward Gray II <james@grayproductions.net> wrote:

[#181705] Re: [ANN] FasterCSV 0.1.6 -- With Header Support! — James Edward Gray II <james@...> 2006/02/27

On Feb 25, 2006, at 7:22 PM, Gregory Brown wrote:

[#181667] Ruby Whitespace Semantics — Almann Goo <almann.goo@...>

Can someone please explain the semantics behind the following:

21 messages 2006/02/27

[#181690] string contains one of these??? — mikkel <mikkel@...>

Imagine,

17 messages 2006/02/27

[#181710] Dynamic stuff and books — Mc Osten <riko@...>

I started using ruby a couple of weeks ago and it's time to make a couple

14 messages 2006/02/27

[#181774] :-( — "Joe Van Dyk" <joevandyk@...>

Someone needs to make a "C++ for Ruby programmers" book. I'm getting

17 messages 2006/02/28

[#181812] Subclassing Struct.new — "Minkoo Seo" <minkoo.seo@...>

Hi group.

37 messages 2006/02/28
[#181814] Re: Subclassing Struct.new — "chiaro scuro" <kiaroskuro@...> 2006/02/28

On 2/28/06, Minkoo Seo <minkoo.seo@gmail.com> wrote:

[#181816] Re: Subclassing Struct.new — "Minkoo Seo" <minkoo.seo@...> 2006/02/28

It works! Thank you.

[#181819] Re: Subclassing Struct.new — "chiaro scuro" <kiaroskuro@...> 2006/02/28

On 2/28/06, Minkoo Seo <minkoo.seo@gmail.com> wrote:

[#181858] Re: Subclassing Struct.new — mental@... 2006/02/28

Quoting chiaro scuro <kiaroskuro@gmail.com>:

[#181862] Re: Subclassing Struct.new — "chiaro scuro" <kiaroskuro@...> 2006/02/28

On 2/28/06, mental@rydia.net <mental@rydia.net> wrote:

[#181885] rcov 0.2.0 - code coverage tool for Ruby — Mauricio Fernandez <mfp@...>

Source code, additional information, screenshots... available at

18 messages 2006/02/28

Ruby script to Module/Class refactor

From: "James B. Byrne" <ByrneJB@...>
Date: 2006-02-15 16:39:18 UTC
List: ruby-talk #180021
I have written my first live ruby script that actually performs useful 
work as an exercise in syntax discovery.  It is very much a straight 
line utility that could just as easily be written in bash.  What I would 
like is for someone to look at the code reproduced below and guide me 
through the steps to convert this into something approximating the ruby 
OOP idiom. I come from a 4GL universe working on mid-range and high end 
iron and OS rather than unix/linux and OOP.  So, I have a major 
challenge getting my head out of first gear.

Looking at this I wondered what can be placed into separate classes.  It 
seems to me that the check for environment variables and defaluts and 
then creating the resulting directory strings and regexp objects is 
either one functional group or two, depending if one considers the 
search for environmental settings totally separate from the directory 
validation process or not.  I tend to see two classes; GetDirs and 
CheckDirs.  Another class would likely be MoveFiles.

module mv2csv

class GetDirs(envlist[],arglist[]=nil)

  def initalize
    ...
  end

  def envlist.each do |env|
    ...
  end
end

My difficulty is that I do not see how all this hangs together after the 
classes and methods are written.  Does the script end up as a ruby 
module? Then what do I do?  Do I have a "main" procedure below the class 
definitions in the module?  I would really appreciate it if someone 
could invest the time to walk me through this because once I see how to 
map what I presently do to the ruby way I expect that many things I am 
unsure about will suddenly become clear.  I am particularly interested 
in how to redo this so that Test::Unit can be used to drive it for 
testing.

Regards,
Jim



The working code:

#!/usr/bin/env ruby
#
#--
# Put RDOC comments between ++ and -- comment tags.
#--
#++
# hll-qpxfr.rb - Byrne, James B. - JBB8 -
#     version:  1.0   2006 Feb 15 - Initial draught.
#
# A ruby script to transfer csv data files delivered via FTP to
# an anonymous world-readable site to a secure data directory
# and append .csv extension to each.
#
# The files originate on an HP3000 and are ascii csv files
# sans header line. Their names take the form QP?????#
#--
#
#### Standard code layout follows.
#
## require <library>    # loads library first time encountered.

require 'find'
require 'fileutils'
include FileUtils::DryRun
require 'syslog'

## GLOBAL CONSTANTS
#
# Run unit tests and traces?
VERBOSE_ON = TRUE

# If the appropriate environmental variables are not set then
# find files matching this pattern:
DFLT_FILE_RE = "^QPCCCMR[[:digit:]]$"  # alternate "^QPCCCMR[1-3]$"

# using these options:
DFLT_FILE_RE_OPT = ""

# and add this extension to them:
DFLT_FILE_EXT = ".csv"

# while searching this directory:
DFLT_DIR_IN = "./ruby/data/source"

# and move the result to here.
DFLT_DIR_OUT = "./ruby/data/target"

# Munge output filenames to lowercase? uppercase? Ignore? (niu: 
2006-02-10)
#DFLT_FILE_OUT_CASE = "IGNORE"
#DFLT_FILE_OUT_CASE = "DNCASE"  # down-shift case
#DFLT_FILE_OUT_CASE = "UPCASE"  # up-shift case

#
## module <Modulename>
#
## class <Classname>
#
## include <library>    # add library code to class defintion
#
## def <methodname>
#
## load <library>       # loads library each time encountered.
#
## main line code after here
#
begin

#
# Set up SYSLOG
log = Syslog.open($0)
log.info("Searching for updated files from HP3000 in ftp drop.")

# ENV check for:  HLL_QP_DIR_IN, HLL_QP_DIR_OUT, HLL_QP_REGEX,
#                 HLL_QP_EXT and overide DEFAULT values if found.
# Regardless, verify that a valid directory is provided.

f_dir_in = ENV["HLL_QP_DIR_IN"] ? ENV["HLL_QP_DIR_IN"].to_s : 
DFLT_DIR_IN
if !FileTest.directory?(f_dir_in) then
  $stderr.print "Invalid source directory " + f_dir_in + " specified.\n"
  log.err(("Invalid source directory " + f_dir_in + " specified"))
  if ENV["HLL_QP_DIR_IN"] then
    $stderr.print "Check setting of ENV: HLL_QP_DIR_IN\n"
    log.err(("Check setting of ENV: HLL_QP_DIR_IN"))
  end
  Process.exit
else
  log.info(("Source directory is: " + f_dir_in))
  if !File.readable?(f_dir_in) then
    $stderr.print f_dir_in + " is NOT readable.  Process aborting.\n"
    log.err((f_dir_in + " is NOT readable.  Process aborting"))
    Process.exit
  end
end

f_dir_out = ENV["HLL_QP_DIR_OUT"] ? ENV["HLL_QP_DIR_OUT"].to_s : 
DFLT_DIR_OUT
if !FileTest.directory?(f_dir_out) then
  $stderr.print "Invalid target directory " + f_dir_out + " 
specified.\n"
  log.err(("Invalid target directory " + f_dir_out + " specified"))
  if ENV["HLL_QP_DIR_OUT"] then
    $stderr.print "Check setting of ENV: HLL_QP_DIR_OUT\n"
    log.err(("Check setting of ENV: HLL_QP_DIR_OUT"))
  end
  Process.exit
else
  log.info(("Target directory is: " + f_dir_out))
  if !File.writable?(f_dir_out) then
    $stderr.print f_dir_out + " is NOT writable.  Process aborting.\n"
    log.err((f_dir_out + " is NOT writable.  Process aborting"))
    Process.exit
  end
end

# set the file extension value if present.  May be nil.
f_nam_ext = ENV["HLL_QP_EXT"] ? ENV["HLL_QP_EXT"].to_s : DFLT_FILE_EXT

# create a valid RE for search.  Note that setting options in
# Regexp.new(RE[,opt]) requires a bit pattern expressed as an integer or 
the
# equivilent library CONSTANTS (REGEXP::INSENSITIVE, etc.) not, as might
# be expected, a character string.  Further, if any non-nil value is
# passed as an option then the /i switch is turned on even if the option
# value is invalid.  (So much for the principle of least surprise!)
f_nam_re_s = ENV["HLL_QP_REGEX"] ? ENV["HLL_QP_REGEX"].to_s : 
DFLT_FILE_RE
f_nam_re = Regexp.new(f_nam_re_s)

# check that any files in the source directory are read-write
# enabled for current process gid or uid.
  Find.find(f_dir_in) do |filename|
    if VERBOSE_ON then
      puts filename + " " + File.basename(filename) + " " + 
f_nam_re.to_s
    end
    if FileTest.file?(filename) and
       File.basename(filename) =~ f_nam_re
    then
      if VERBOSE_ON then
        puts filename
        puts FileTest.readable?(filename) ? "\treadable" \
                                          : "\tnot readable"
        puts FileTest.writable?(filename) ? "\twritable" \
                                          : "\tnot writable"
        puts  filename + " moves to " + \
              (File.join(f_dir_out,  (File.basename(filename) + 
f_nam_ext)))
      else
        # Move oldfile to same name in target dir with extension 
appended.
        # If we ever enable case munging then this is where it will 
happen.
        FileUtils.move((filename), \
          (File.join(f_dir_out,  (File.basename(filename) + 
f_nam_ext))))
        log.info(("Moving " + filename + " to " + \
          (File.join(f_dir_out,  (File.basename(filename) + 
f_nam_ext)))))
      end
      next
    else
      # do not recurse directories.
      if FileTest.directory?(filename)
        if VERBOSE_ON then puts filename + " is a directory." end
        if File.basename(filename)!= File.basename(f_dir_in)
          if VERBOSE_ON then
            puts File.basename(filename) + " is not a regular file."
          end
          Find.prune
        else
          next
        end
      end
    end
  end

#
## catch problems below here
rescue
  if VERBOSE_ON then
    puts "rescue block entered: " + $!.to_s
    puts
  end

#
## put finalizer code below here
ensure
  if VERBOSE_ON then
    puts "ensure block entered: " + $!.to_s
    puts
  end

##-- put test code below here
if VERBOSE_ON

#
## Display working data set.

  puts "\t Input directory: " + f_dir_in.to_s
  puts "\tTarget directory: " + f_dir_out.to_s
  puts "\tSet extension to: " + f_nam_ext.to_s
  puts "\nThe passed regexp is: \n\t" + f_nam_re_s
  puts "The regexp used is: "
  p f_nam_re
  puts "$= is: " + $=.to_s

# Set up a set of strings for possible file names
  qpa = 
["qpcccmr1","QPCCCMR1","QPCCMMR1","qpCCCMR1","QPCCCMRC","QPCCCMR1.csv"]
  qpa += ["QPCCCMR9","XXQPCCCMR9","QPCCCMR9yyy","XyZQPCCCMR3AbC"]

# Test to see which names match
  qpa.each do |a|
    case a
      when f_nam_re then puts a + " matches"
      else puts a + " does not match"
    end
  end

  puts  "Ruby run of " + __FILE__.to_s + " as " + $0.to_s + \
        " ends at line: " + __LINE__.to_s

#end VERBOSE_ON block
  end

  log.info(($0 + " finished"))
#end main
end

-- 
Posted via http://www.ruby-forum.com/.

In This Thread

Prev Next