[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01868] Re: Another question from a newbie

From: Dave Thomas <Dave@...>
Date: 2000-03-15 21:50:42 UTC
List: ruby-talk #1868
"David Douthitt" <DDouthitt@cuna.com> writes:

> Why not use this pattern substitution (instead of gsub! and yield) -
> 
> line = s/[ \t]*#.*$//;
> next if /^$/;
> 
> Not sure how that translates to Ruby....

The s/// is a sub(/\s*#.*/, '').

The only reason for the separate method is reusability: the next time
you need to read an Oracle configuration or whatever you've got the
useful configReader method in your toolkit.

> Here's the entire code, including invocation from ksh:

I just ran this without error on my box. However, wasn;t it the
version with comment? that was giving you a problem?



Regards


Dave

In This Thread

Prev Next