Forum: Ruby Compiling ruby code

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F9deb7dcaf4c05dec929ba396bb0545b?d=identicon&s=25 Simon Nielsen (z1n)
on 2006-03-29 14:37
i know very little about ruby, have only looked shortly at rails

Is it possible to compile my own code so that it cannot be viewed by
others ?

much like the zend compiler does for php
Afb2adb7cc2540207e96ff9ad1b5cb96?d=identicon&s=25 Bill Barnhill (Guest)
on 2006-03-29 14:58
(Received via mailing list)
Yes and no.

There is Rubyscript2exe:
http://www.erikveen.dds.nl/rubyscript2exe/index.html

That said suspect it would not be too hard to hack into the exe and
retrieve
the script, as I believe it stores the script text and then interprets
it
using an embedded interpreter.  I think any language that's interpreted
will
be hackable, question is how hard you can make it for them.  I also
suspect
we can make it a lot harder in Ruby 2.0, with a Ruby VM.

You might also want to check out:
All In One Ruby - http://www.erikveen.dds.nl/allinoneruby/index.html

=Bill.Barnhill
D57f4a4788599a38494865a121f16bbe?d=identicon&s=25 dseverin (Guest)
on 2006-03-29 14:58
Simon Nielsen wrote:
> i know very little about ruby, have only looked shortly at rails
>
> Is it possible to compile my own code so that it cannot be viewed by
> others ?
>
> much like the zend compiler does for php

There's currently no ruby compiler.

If you want better performance take look at YARV project (
http://www.atdot.net/yarv/ )

If you want to protect your code from reuse, here are some well-known
rules ( http://www.faqs.org/docs/artu/ch01s06.html )

Just INVERT them all and apply INVERTED rules to your code and mind -
and there will be no need to compile or obfuscate your code ever :)))
Cfdeff3ac35010e4de8f85d954f24f4a?d=identicon&s=25 Damphyr (Guest)
on 2006-03-29 15:01
(Received via mailing list)
Bill Barnhill wrote:
> Yes and no.
>
> There is Rubyscript2exe:
> http://www.erikveen.dds.nl/rubyscript2exe/index.html
>
> That said suspect it would not be too hard to hack into the exe and retrieve
> the script, as I believe it stores the script text and then interprets it
> using an embedded interpreter.  I think any language that's interpreted will
Well, in this case it's not exactly hard, it's more like childlike easy:
rubyscript2exe untars the whole ruby environment, together with your
script, in the temp directory. Getting the source means browsing the
temp folder :)
Cheers,
V.-
--
http://www.braveworld.net/riva
D8831c4665a164c6ce484003deb1afd6?d=identicon&s=25 Guillaume Marcais (Guest)
on 2006-03-29 15:50
(Received via mailing list)
Le 29 mars 06, à 07:59, Damphyr a écrit :

> Well, in this case it's not exactly hard, it's more like childlike
> easy:
> rubyscript2exe untars the whole ruby environment, together with your
> script, in the temp directory. Getting the source means browsing the
> temp folder :)

It's even easier than that. The executable created has an option
--eee-justextract, which will extract the whole thing in the current
directory...

Guillaume.
90ebe8da17aabd36cc30d9f96a530e6f?d=identicon&s=25 James H. (Guest)
on 2006-03-29 15:59
(Received via mailing list)
Thanks for the link dseverin!  Definitely add to my to-do list.

James H.
This topic is locked and can not be replied to.