I have a script written in Ironruby that uses a C# .dll to retrieve a hash. I then use that hash throughout the rest of my Ruby code. I would rather not run my entire script off of the Ironruby interpreter. Is there anyway to run a section of code on the IR interpreter, get the hash, and execute the rest of the code via the regular Ruby interpreter?
Thanks
One possible solution is to split up the script into two parts, the first part executed by iron ruby has to save his state in a yaml file before handing control to the second part which will run by ruby
here a small demo:
here the source of the first part for ironruby (demo_ir.rb):
here the code of the second part for ruby 1.8 (demo_ruby.rb)
and the launcher:
if you run the script in a concurrent environment you can generate a unique temporary name of the yaml file in the ironruby script avoiding that two process ( or thread ) try to write the same file.
If you prefer you could use some C# line of code, instead of a .bat, to integrate the two parts of the script, but this is a is a bit more difficult (IMHO)
I successfully test this solution using:
ask if you need some clarification