Created
April 4, 2012 13:31
-
-
Save nikitug/2301064 to your computer and use it in GitHub Desktop.
JRuby compile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jruby-jars' | |
classpath = [JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path].join(File::PATH_SEPARATOR) | |
files = Dir["**/*.rb"].reject{|file| file.match(/compile\.rb$/)} | |
%x{java -Djruby.compat.version=1.9 -classpath #{classpath} org.jruby.Main -S jrubyc #{files.join(" ")}} | |
files.each do |ruby_source| | |
File.open(ruby_source, "w") { |f| f.write("require __FILE__.sub(/\.rb$/, '.class')") } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment