Forum: JRuby Obfuscating rails code with jruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Matt R. (Guest)
on 2015-06-26 01:20
Well im trying to turn my .rb files (for example
application_controller.rb) into .class files (java byte files) to
obfuscate them.

I can do that by running javac application_controller.rb from the
command line and it gives me application_controller.class which is
pretty obfuscated.

According to some older documentation I should be able to delete the
application_controller.rb and jRuby will just use the .class file at
runtime -

However that doesnt work at all. So then I tried using a java_import
method to load that class like this -

But I get an error saying 'cannot import application_controller as
application_controller' Im guessing because ruby wants camel case class
names and I can see by decompiling the byte code that the java class is
named application_controller.

Basically, I just need to figure out a way to obfuscate the source to
protect it.

ALSO, I have looked at using warble to generate a .war, but we already
have a solid IIS and puma environment using jruby that I cant really
mess with.
This topic is locked and can not be replied to.