[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Run ruby application with params

Luiz Macchi

8/22/2007 11:36:00 AM

Hi, i need to run an aplication and send a param with it
like
$ ruby application.rb -param_here

Is it possible ?
how to receive this param_here in the ruby application ?

thanks any help
--
Posted via http://www.ruby-....

3 Answers

Stephane Wirtel

8/22/2007 12:38:00 PM

0

Luiz Macchi a écrit :
> Hi, i need to run an aplication and send a param with it
> like
> $ ruby application.rb -param_here
>
> Is it possible ?
> how to receive this param_here in the ruby application ?
>
> thanks any help
Hi,


You can use CmdParse or OptionParser gems

Robert Klemme

8/22/2007 3:24:00 PM

0

2007/8/22, Stephane Wirtel <stephane.wirtel@descasoft.com>:
> Luiz Macchi a écrit :
> > Hi, i need to run an aplication and send a param with it
> > like
> > $ ruby application.rb -param_here
> >
> > Is it possible ?
> > how to receive this param_here in the ruby application ?
> >
> > thanks any help
> Hi,
>
>
> You can use CmdParse or OptionParser gems

OptionParser is not a gem AFAIK - it's part of the std lib.

robert

William James

8/22/2007 6:01:00 PM

0

On Aug 22, 6:35 am, Luiz Macchi <gugui_sarubi_mac...@yahoo.com.br>
wrote:
> Hi, i need to run an aplication and send a param with it
> like
> $ ruby application.rb -param_here
>
> Is it possible ?
> how to receive this param_here in the ruby application ?
>
> thanks any help
> --
> Posted viahttp://www.ruby-....

$ ruby temp.rb fee fi fo fum
["fee", "fi", "fo", "fum"]

And the file temp.rb has
p ARGV