Run ruby application with params

L

Luiz Macchi

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
 
S

Stephane Wirtel

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
 
R

Robert Klemme

2007/8/22 said:
Luiz Macchi a =E9crit :
Hi,


You can use CmdParse or OptionParser gems

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

robert
 
W

William James

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

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

And the file temp.rb has
p ARGV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top