summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2013-01-07 00:00:25 -0800
committerTerence Lee <hone02@gmail.com>2013-01-07 00:13:33 -0800
commitdc096424682a159305004065ff5fc15a86cd41c1 (patch)
tree039f707d376521d044c4ec954ba92907e5ad49d5
parent8803a6857260c14db89754cf3975dbf9c088df5c (diff)
downloadbundler-dc096424682a159305004065ff5fc15a86cd41c1.tar.gz
make --standalone's setup.rb ruby version agnostic /cc @carllerche
-rw-r--r--lib/bundler/installer.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index a99f0650bf..ab866c5070 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -175,12 +175,15 @@ module Bundler
spec.require_paths.each do |path|
full_path = File.join(spec.full_gem_path, path)
- paths << Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
+ gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
+ paths << gem_path.to_s.sub("#{SystemRubyVersion.new.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}')
end
end
File.open File.join(bundler_path, "setup.rb"), "w" do |file|
+ file.puts "# ruby 1.8.7 doesn't define RUBY_ENGINE"
+ file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'"
file.puts "path = File.expand_path('..', __FILE__)"
paths.each do |path|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}