From: Alex Fenton Date: 2008-08-29T03:30:18+09:00 Subject: Re: A general doubt Lex Williams wrote: > Adam Shelly wrote: >> On 8/28/08, Michael Morin wrote: >>> something like this exists for Ruby: >>> >>> http://www.erikveen.dds.nl/rubyscript2exe/ >>> >>> But I'm sure someone here has done this and can give you some more specific >>> advice. >>> >> I have used rubyscript2exe with FxRuby, and it works fine. (Startup >> can be a little slow, as it unpacks a bunch of stuff to a temporary >> directory, but after that it works great.) Rubyscript2exe is an easy and pretty effective solution for both wxRuby and FxRuby. It's not perfect though, startup time being one of the problems as the whole package gets bigger. For more complicated applications, you can instead package up ruby.exe, the compiled ruby runtime and all the needed .rb files (you can find this out by inspecting $LOADED_FEATURES) and then using something like NSIS to install this minimal environment on the end user's machine. > but,what if I don't want the end-user to be able to see the source code > of the script ? Neither rubyscript2exe nor the other method I describe provide any protection. Ruby remains an interpreted and highly dynamic language so it's difficult to find any very effective scheme to distribute without source. Perhaps the nearest you can get at the moment with MRI is to use 1.9 and its RubyVM classes to distribute code as opcodes. There may be more options available with JRuby, but of course FXRuby and WxRuby aren't available there; you'll need to use SWING etc for the GUI. alex