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-09 14:47:30 -0800
commite4327059d982a9b971d80fb93c01e26d62701337 (patch)
treeb9293532bb3410dae7adca31688700a86bb5c2a6
parent20bc9217fbefada73b64d5bc1a5c91474feb7321 (diff)
downloadbundler-e4327059d982a9b971d80fb93c01e26d62701337.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 15588d1ed9..857246aaca 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -189,7 +189,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
@@ -197,6 +197,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}")}