Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Remove all version overriding stuff
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
deivid-rodriguez committed Apr 22, 2019
1 parent 242e5d5 commit 4e52598
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/bundler/version.rb
@@ -1,23 +1,7 @@
# frozen_string_literal: false

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.1.0.pre.1".freeze 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.1.0.pre.1".freeze

def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
Expand Down

0 comments on commit 4e52598

Please sign in to comment.