Sai said:
Do you know how loading a Ruby source with parameters? I had try so by
using:
load(my_file my_arg)
but it do not seems to work...
I think you're confusing two things.
(1) Loading in more Ruby code to the currently-running Ruby interpreter.
This is done using "load" or "require". There is no concept of
"parameters" here. However you could set a global variable (e.g. $foo)
or a constant (Foo), which the code in the other file makes use of.
But it would be more normal for the other file just to define modules or
classes, and then after the load has completed you invoke one of those
modules or classes, at which point you can pass whatever parameters you
like.
(2) Forking and execing a new child process. This could be another
Ruby interpreter, but it could also be any other program on your system.
When you do this, you can pass command-line arguments (and/or
environment variables and open files)
The simplest way is with Kernel#system, e.g.
system("/bin/prog","arg1","arg2")
but other options include backticks, IO.popen, the open3 and open4
libraries, and the low-level Kernel#fork and Kernel#exec calls.