diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-22 22:51:30 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-22 22:51:30 +0100 |
commit | 6016cc3183d9cf9481250f586930e99dac1af7a8 (patch) | |
tree | 3fbe56e6dd95f9758dbc17425514068a5cd6d5f7 | |
parent | 25503c30574cfe202976c560b4b4217a597d8cef (diff) | |
download | bundler-6016cc3183d9cf9481250f586930e99dac1af7a8.tar.gz |
Partially restore hack
-rw-r--r-- | lib/bundler/version.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index cf8b2c5812..634e45af23 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -3,6 +3,24 @@ module Bundler VERSION = "2.0.0.dev".freeze + if ENV["BUNDLE_SPEC_RUN"] + # We're doing this because we might write tests that deal + # with other versions of bundler and we are unsure how to + # handle this better. + def self.overwrite_loaded_gem_version + begin + require "rubygems" + rescue LoadError + return + end + return unless bundler_spec = Gem.loaded_specs["bundler"] + return if bundler_spec.version == VERSION + bundler_spec.version = Bundler::VERSION + end + private_class_method :overwrite_loaded_gem_version + overwrite_loaded_gem_version + end + def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i end |