зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Autoload name_tuple.rb before use
- Resolver asked Molinillo to resolve-then-activate, which led to using Gem::NameTuple before any require had been passed Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> https://github.com/rubygems/rubygems/commit/e11782b0c8
This commit is contained in:
Родитель
39322317f3
Коммит
bb3d80bbbe
|
@ -1307,6 +1307,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
||||||
autoload :DependencyList, File.expand_path('rubygems/dependency_list', __dir__)
|
autoload :DependencyList, File.expand_path('rubygems/dependency_list', __dir__)
|
||||||
autoload :Installer, File.expand_path('rubygems/installer', __dir__)
|
autoload :Installer, File.expand_path('rubygems/installer', __dir__)
|
||||||
autoload :Licenses, File.expand_path('rubygems/util/licenses', __dir__)
|
autoload :Licenses, File.expand_path('rubygems/util/licenses', __dir__)
|
||||||
|
autoload :NameTuple, File.expand_path('rubygems/name_tuple', __dir__)
|
||||||
autoload :PathSupport, File.expand_path('rubygems/path_support', __dir__)
|
autoload :PathSupport, File.expand_path('rubygems/path_support', __dir__)
|
||||||
autoload :Platform, File.expand_path('rubygems/platform', __dir__)
|
autoload :Platform, File.expand_path('rubygems/platform', __dir__)
|
||||||
autoload :RequestSet, File.expand_path('rubygems/request_set', __dir__)
|
autoload :RequestSet, File.expand_path('rubygems/request_set', __dir__)
|
||||||
|
|
|
@ -302,6 +302,21 @@ class TestGem < Gem::TestCase
|
||||||
assert_equal %w[a-1 b-2 c-1], loaded_spec_names
|
assert_equal %w[a-1 b-2 c-1], loaded_spec_names
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_activate_bin_path_in_debug_mode
|
||||||
|
a1 = util_spec 'a', '1' do |s|
|
||||||
|
s.executables = ['exec']
|
||||||
|
end
|
||||||
|
|
||||||
|
install_specs a1
|
||||||
|
|
||||||
|
output, status = Open3.capture2e(
|
||||||
|
{ "GEM_HOME" => Gem.paths.home, "DEBUG_RESOLVER" => "1" },
|
||||||
|
Gem.ruby, "-I", File.expand_path("../../lib", __dir__), "-e", "\"Gem.activate_bin_path('a', 'exec', '>= 0')\""
|
||||||
|
)
|
||||||
|
|
||||||
|
assert status.success?, output
|
||||||
|
end
|
||||||
|
|
||||||
def test_activate_bin_path_gives_proper_error_for_bundler
|
def test_activate_bin_path_gives_proper_error_for_bundler
|
||||||
bundler = util_spec 'bundler', '2' do |s|
|
bundler = util_spec 'bundler', '2' do |s|
|
||||||
s.executables = ['bundle']
|
s.executables = ['bundle']
|
||||||
|
|
Загрузка…
Ссылка в новой задаче