Ruby 2.0 bytecode export / import

Hi Everyone!

I’m looking for a solution to be able to deploy a Ruby script of mine on
a foreign server without giving out all of my original source code.
Instead I’d be happy to be able to generate bytecode from my source and
install that one.

I read about the bytecode export / import support in Ruby 2.0 here:

http://www.rubyinside.com/ruby-2-0-implementation-work-begins-what-is-ruby-2-0-and-whats-new-5515.html

But I couldn’t figure out how to generate bytecode from my source, and
some search brought up the following issue:

Does anyone have any information when the 2.0 branch will contain full
bytecode support? Or what I can expect on short term?

Also, I can generate bytecode with JRuby, but since I’m using native
libs in my code (ruby-mysql), it doesn’t help currently. The code is
also tested so I wouldn’t go into any modification. So other solution is
welcome too.

Any recommendation is greatly appreciated!

Thanks.

Why don’t you use jRuby and set the warbler to compile?

Julian

Thanks. Unfortunately it says:

“This uses jrubyc to precompile all .rb files in your application to
.class files…”

which in my case is not good, cause I use native libs too and as I
wrote, I already tested and JRuby cannot do that for me. So AFAIK JRuby
(jrubyc) is good only for codes without 3rd party extensions - or only
if someone writes the code originally for JRuby and its libs (jdbc
etc.).

Julian L. wrote in post #1103591:

Why don’t you use jRuby and set the warbler to compile?

Julian

Thanks for the tip. Unfortunately I can’t seem to find a good
documentation as of how to use it properly.

But I also found this topic from here:
http://www.ruby-forum.com/topic/154854#684667

Anyway, I will rather enable too the load function with
rb_define_singleton_method in iseq.c and recompile the interpreter.
Seems an easier way to go for me now.

On 29/03/2013, at 7:42 PM, Andras H. [email protected] wrote:

Anyway, I will rather enable too the load function of
rb_define_singleton_method and recompile the interpreter. Seems an
easier way to go for me now.


Posted via http://www.ruby-forum.com/.

Read this:

Especially the parts about compiled :stuck_out_tongue:

Julian