Last updated January 18, 2011 06:16, by qmxme
Feedicon  

DO NOT EDIT - MOVED TO HERE => RailsAOT

Introduction

AOT compilation of Ruby on Rails controllers and models can be useful for protecting/hiding/obfuscating/obscuring your Ruby on Rails source code when you develop applications not hosted by you. (Naturally this is not a secure solution for protecting source code.)

JRuby 1.1 is required.

Howto

  • Compile your controller/model using jrubyc

$jrubyc your_controller.rb

  • Choose one of the following three ways:
1. Two files, different file prefixes
*Rename your compiled file to e.g. your_controller_compiled.class and place it in the same directory as your Ruby controller/model
$mv ruby/your_controller.class ./your_controller_compiled.class
* Replace the content of your original Ruby controller/model (e.g. your_controller.rb) with a reference to your newly compiled file
require 'your_controller_compiled'
2. Two files, same file prefix (does this work by luck, or are .class files prioritized?)
*Move your compiled file to the same directory as your Ruby controller/model
$mv ruby/your_controller.class ./
* Replace the content of your original Ruby controller/model (e.g. your_controller.rb) with a reference to your newly compiled file
require 'your_controller'
3. Replace your .rb file with your .class file
$mv ruby/your_controller.class ./your_controller.rb
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close