1

Is it possible to compile all .rb source files files (including the configuration source file files) of Ruby on Rails to .class files using JRuby, pack it into a .war file and deploy to JBoss or another Java appserver?

razenha
  • 7,660
  • 6
  • 37
  • 53
  • Duplicate of http://stackoverflow.com/questions/147671/whats-the-best-way-to-deploy-a-jruby-on-rails-application-to-tomcat – Chris Ledet Sep 21 '11 at 17:13
  • It's not a duplicate... I don't want to simply pack my Ruby files into a .war and deploy to a Java appserver, I want to also compile my .rb files to .class files - I want to hide my ruby source code. – razenha Sep 22 '11 at 17:16

2 Answers2

3

Check out warbler for this purpose.

From the main page:

Warbler is a gem that makes a .war file out of a Rails, Merb, or Rack-based application. The intent is to provide a minimal, flexible, ruby-like way to bundle all your application files for deployment to a Java application server.

gphil
  • 149
  • 2
  • I don't want to simply pack my Ruby files into a .war and deploy to a Java appserver, I want to also compile my .rb files to .class files - I want to hide my ruby source code. – razenha Sep 22 '11 at 17:16
  • 1
    warbler will do all you are asking including making .class files. – ffoeg Dec 11 '11 at 03:15
  • actually, if you open the war file, you still see the ruby code. – Samuel Dec 25 '16 at 10:35
0

the following command should compile all .rb to .class

warble compiled

in the warble.rb file you can uncomment the line to compile only some Ruby files

# config.compiled_ruby_files = FileList['app/**/*.rb']
Daya Sharma
  • 2,855
  • 2
  • 15
  • 12