On Tue, Oct 1, 2013 at 8:40 AM, David Unric <lists / ruby-forum.com> wrote:

> I'm looking for an already made tool to mangle source code of a ruby
> program. By mangling I mean renaming all identifiers (classes, methods,
> variables, constants) with autogenerated alphanumeric ones, stripping
> all code indentation etc. Something that would prevent an easy code
> understanding and copy&paste in another project.
>
> I know there are some limitations like code evaled from a string or
> invoking methods indirectly by sending their name to an object, but
> that's all I can live with and keep care.
> Ideally something like bytecode compiler for YARV based rubys.
>
> Does anybody know such or similar code mangler ?

I wonder whether that would be possible at all.  For example, for a
library all your public methods are part of the interface and you must
not change them.  Then, if you have code in your program which uses
send() (probably even constructing the method name dynamically) or
accesses instance variables via name I am not sure whether obfuscating
would be possible.  If it was, you might end up with loads of readable
strings in the "obfuscated" code rendering the obfuscation useless.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/