aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-06-10 02:02:30 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-06-10 02:02:30 -0500
commit4f8a41a3e8aaf0697c9b1d57cceee26df212841e (patch)
tree8529a785b7a9469b114ab1644fcff0367a81621d /lib
parent9dbe160f9821d1c27a7dc1cd9532e754cb74e96d (diff)
downloadbundler-4f8a41a3e8aaf0697c9b1d57cceee26df212841e.tar.gz
Fix stubbing RUBY_VERSION on 1.8.7
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/ruby_version.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb
index 9c144448..71174dc7 100644
--- a/lib/bundler/ruby_version.rb
+++ b/lib/bundler/ruby_version.rb
@@ -103,9 +103,11 @@ module Bundler
# not defined in ruby 1.8.7
"ruby"
end
+ # :sob: mocking RUBY_VERSION breaks stuff on 1.8.7
+ ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
ruby_engine_version = case ruby_engine
when "ruby"
- RUBY_VERSION.dup
+ ruby_version
when "rbx"
Rubinius::VERSION.dup
when "jruby"
@@ -113,7 +115,7 @@ module Bundler
else
raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized"
end
- @ruby_version ||= RubyVersion.new(RUBY_VERSION.dup, RUBY_PATCHLEVEL.to_s, ruby_engine, ruby_engine_version)
+ @ruby_version ||= RubyVersion.new(ruby_version, RUBY_PATCHLEVEL.to_s, ruby_engine, ruby_engine_version)
end
private