Skip to content

Commit

Permalink
[rubygems/rubygems] Cleanup old legacy code
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and matzbot committed May 9, 2022
1 parent 0161dc3 commit 00e5e82
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
6 changes: 1 addition & 5 deletions lib/bundler/rubygems_integration.rb
Expand Up @@ -283,11 +283,7 @@ def replace_gem(specs, specs_by_name)

e = Gem::LoadError.new(message)
e.name = dep.name
if e.respond_to?(:requirement=)
e.requirement = dep.requirement
elsif e.respond_to?(:version_requirement=)
e.version_requirement = dep.requirement
end
e.requirement = dep.requirement
raise e
end

Expand Down
6 changes: 1 addition & 5 deletions lib/bundler/runtime.rb
Expand Up @@ -301,11 +301,7 @@ def check_for_activated_spec!(spec)
e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
"but your Gemfile requires #{spec.name} #{spec.version}. #{suggestion}"
e.name = spec.name
if e.respond_to?(:requirement=)
e.requirement = Gem::Requirement.new(spec.version.to_s)
else
e.version_requirement = Gem::Requirement.new(spec.version.to_s)
end
e.requirement = Gem::Requirement.new(spec.version.to_s)
raise e
end
end
Expand Down
26 changes: 0 additions & 26 deletions spec/bundler/runtime/setup_spec.rb
Expand Up @@ -341,19 +341,6 @@ def clean_load_path(lp)
expect(out).to eq("WIN")
end

it "version_requirement is now deprecated in rubygems 1.4.0+ when gem is missing" do
run <<-R
begin
gem "activesupport"
puts "FAIL"
rescue LoadError
puts "WIN"
end
R

expect(err).to be_empty
end

it "replaces #gem but raises when the version is wrong" do
run <<-R
begin
Expand All @@ -366,19 +353,6 @@ def clean_load_path(lp)

expect(out).to eq("WIN")
end

it "version_requirement is now deprecated in rubygems 1.4.0+ when the version is wrong" do
run <<-R
begin
gem "rack", "1.0.0"
puts "FAIL"
rescue LoadError
puts "WIN"
end
R

expect(err).to be_empty
end
end

describe "by hiding system gems" do
Expand Down

0 comments on commit 00e5e82

Please sign in to comment.