Permalink
Browse files

use a generic jruby folder for JRUBY_HOME

  • Loading branch information...
1 parent 356d544 commit 5615e118811acce2d3f69fa6d85cd497bf85a794 @hone hone committed Jan 11, 2012
Showing with 14 additions and 2 deletions.
  1. +14 −2 lib/language_pack/ruby.rb
View
16 lib/language_pack/ruby.rb
@@ -33,7 +33,7 @@ def default_config_vars
"GEM_PATH" => slug_vendor_base,
}
- ruby_version_jruby? ? vars.merge("JRUBY_HOME" => slug_vendor_ruby, "JAVA_OPTS" => '-Xmx384m -Xss512k') : vars
+ ruby_version_jruby? ? vars.merge("JRUBY_HOME" => slug_vendor_jruby, "JAVA_OPTS" => '-Xmx384m -Xss512k') : vars
end
def default_process_types
@@ -76,6 +76,12 @@ def slug_vendor_ruby
"vendor/#{ruby_version}"
end
+ # the relative path to the vendored jruby directory without the version number
+ # @return [String] resulting path
+ def slug_vendor_jruby
+ "vendor/jruby"
+ end
+
# the absolute path of the build ruby to use during the buildpack
# @return [String] resulting path
def build_ruby_path
@@ -152,6 +158,12 @@ def install_ruby
end
error invalid_ruby_version_message unless $?.success?
+ if ruby_version_jruby?
+ Dir.chdir("vendor") do
+ run("ln -s #{ruby_version} jruby")
+ end
+ end
+
bin_dir = "bin"
FileUtils.mkdir_p bin_dir
run("cp #{slug_vendor_ruby}/bin/* #{bin_dir}")
@@ -185,7 +197,7 @@ def setup_ruby_install_env
ENV['RBX_LIB'] = "#{build_path}/#{slug_vendor_ruby}/lib"
end
if ruby_version_jruby?
- ENV['JRUBY_HOME'] = slug_vendor_ruby
+ ENV['JRUBY_HOME'] = slug_vendor_jruby
end
end

0 comments on commit 5615e11

Please sign in to comment.