Reputation: 3607
I have a Pathname
that points to a ruby file.
How do I execute that file from with in another ruby script.
I am looking for something like:
Kernel.execute(pathname)
It needs to share memory so the solution must run the file within the MRI process.
Upvotes: 0
Views: 88
Reputation: 27463
load pathname
The difference between load
and require
is with load
, the file will always be executed. With require
, it will be executed only once.
Upvotes: 3