summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-21 15:12:35 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-21 15:17:45 +0100
commitaf908ce0f0ad8a19fabc13b835f68b5b21fcb322 (patch)
tree68136930fb292b7b929fbb442f4e50644a82566c
parentb7de89fa8c1e39251051d26298a902c2630b2e2b (diff)
downloadbundler-af908ce0f0ad8a19fabc13b835f68b5b21fcb322.tar.gz
Remove all version overriding stuff
By doing this we avoid circular requires (`rubygems` requires `bundler` via `USE_GEMDEPS`, `bundler` requires `rubygems` when loading its own version), and also redefinition warnings when the `bundler.gemspec` is evaluated with `rubygems` already loaded (for example, when running `ruby setup.rb` from `rubygems` repo). We seem to already have other mechanisms in place for overriding the loaded bundler version (`BUNDLER_SPEC_VERSION`), so this seems unnecessary? Let's see what CI says.
-rw-r--r--lib/bundler/version.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 75d0817cca..07240ae8cc 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -4,23 +4,7 @@
# rubocop:disable MutableConstant
module Bundler
- # 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.
- VERSION = "2.0.0.dev" unless defined?(::Bundler::VERSION)
-
- 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
+ VERSION = "2.0.0.dev"
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i