summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2013-01-08 23:51:46 -0800
committerTerence Lee <hone02@gmail.com>2013-01-08 23:51:46 -0800
commit7a0aaccbd58c8eb4874d2978daa4115cf0bf6c43 (patch)
tree35e8e818119e670981ceca57c8594ee4800df4c2
parentdc096424682a159305004065ff5fc15a86cd41c1 (diff)
downloadbundler-7a0aaccbd58c8eb4874d2978daa4115cf0bf6c43.tar.gz
only hit RbConfig once vs every require for --standalone
-rw-r--r--lib/bundler/installer.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index ab866c5070..35bb887422 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -176,7 +176,7 @@ module Bundler
spec.require_paths.each do |path|
full_path = File.join(spec.full_gem_path, 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"]}')
+ paths << gem_path.to_s.sub("#{SystemRubyVersion.new.engine}/#{RbConfig::CONFIG['ruby_version']}", '#{ruby_engine}/#{ruby_version}')
end
end
@@ -184,6 +184,7 @@ module Bundler
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 "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
file.puts "path = File.expand_path('..', __FILE__)"
paths.each do |path|
file.puts %{$:.unshift File.expand_path("\#{path}/#{path}")}