Forum: Ruby Command line arguments

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2007-05-13 17:31
(Received via mailing list)
Hi,

I wrote a ruby script using command line options for configuration
purposes.
Now I want to write a second script which should call the first one
setting some options as default.

What is the best way to do this?

As far as I know, I can not pass option to include or require.


Thanks
  Peter
Robert K. (Guest)
on 2007-05-13 18:50
(Received via mailing list)
On 13.05.2007 15:28, removed_email_address@domain.invalid wrote:
> I wrote a ruby script using command line options for configuration
> purposes.
> Now I want to write a second script which should call the first one
> setting some options as default.
>
> What is the best way to do this?
>
> As far as I know, I can not pass option to include or require.

If you want to invoke it via "load" (i.e. in the same process) then you
should probably use another mechanism to transport configuration
information.  For example, you write your classes that do something and
provide settings directly - if you are in the same process there is
really no point in creating string based arguments and parsing them in
the other bit.

Kind regards

  robert
This topic is locked and can not be replied to.