зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Avoid standard requires while loading shared helpers
We should make sure Bundler does not trigger RubyGems require logic for gem activation until it had the chance to register its own monkeypatches to RubyGems. https://github.com/rubygems/rubygems/commit/fbd2ff86b9
This commit is contained in:
Родитель
e926298343
Коммит
69c87619bd
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rbconfig"
|
||||
|
||||
module Bundler
|
||||
WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/
|
||||
FREEBSD = RbConfig::CONFIG["host_os"].to_s.include?("bsd")
|
||||
|
|
|
@ -4,9 +4,7 @@ require "rubygems" unless defined?(Gem)
|
|||
|
||||
module Bundler
|
||||
class RubygemsIntegration
|
||||
require "monitor"
|
||||
|
||||
EXT_LOCK = Monitor.new
|
||||
autoload :Monitor, "monitor"
|
||||
|
||||
def initialize
|
||||
@replaced_methods = {}
|
||||
|
@ -173,7 +171,7 @@ module Bundler
|
|||
end
|
||||
|
||||
def ext_lock
|
||||
EXT_LOCK
|
||||
@ext_lock ||= Monitor.new
|
||||
end
|
||||
|
||||
def spec_from_gem(path)
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "pathname"
|
||||
require "rbconfig"
|
||||
|
||||
require_relative "version"
|
||||
require_relative "constants"
|
||||
require_relative "rubygems_integration"
|
||||
require_relative "current_ruby"
|
||||
|
||||
module Bundler
|
||||
autoload :WINDOWS, File.expand_path("constants", __dir__)
|
||||
autoload :FREEBSD, File.expand_path("constants", __dir__)
|
||||
autoload :NULL, File.expand_path("constants", __dir__)
|
||||
|
||||
module SharedHelpers
|
||||
autoload :Pathname, "pathname"
|
||||
|
||||
def root
|
||||
gemfile = find_gemfile
|
||||
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
|
||||
|
|
Загрузка…
Ссылка в новой задаче