Hello. I used RubyVM::InstructionSequence to compile file test.rb and I
used .to_a function to save it to an array and Marshal.dump to dump the
array to a file.
Is the way to eval the sequence I have in the file ?
Hello. I used RubyVM::InstructionSequence to compile file test.rb and I
used .to_a function to save it to an array and Marshal.dump to dump the
array to a file.
I know nothing about RubyVM, but you are using Marshal the wrong
way. Marshal::dump returns a string, which you have to write to your
file. For example:
File::open(‘yourfile’,‘wb’) do |f|
f.write(Marshal::dump(WHATEVER-YOU-DUMP))
end
I know nothing about RubyVM, but you are using Marshal the wrong
way. Marshal::dump returns a string, which you have to write to your
file. For example: