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

Commit 86bddc8

Browse files
homusegiddins
authored andcommitted
Auto merge of #5106 - bundler:seg-public-gem, r=indirect
[RubygemsIntegration] Temporarily make #gem public again Closes #5102 \c @indirect @schneems (cherry picked from commit 90b99f2)
1 parent af6ac0a commit 86bddc8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/bundler/rubygems_integration.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ def replace_gem(specs)
348348

349349
true
350350
end
351+
352+
# TODO: delete this in 2.0, it's a backwards compatibility shim
353+
# see https://github.com/bundler/bundler/issues/5102
354+
kernel_class.send(:public, :gem)
351355
end
352356
end
353357

spec/runtime/setup_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,4 +1094,19 @@ def lock_with(ruby_version = nil)
10941094
expect(post_bundler).to match(/\d+\.\d+\.\d+/)
10951095
end
10961096
end
1097+
1098+
describe "after setup" do
1099+
it "allows calling #gem on random objects" do
1100+
install_gemfile <<-G
1101+
source "file:#{gem_repo1}"
1102+
gem "rack"
1103+
G
1104+
ruby! <<-RUBY
1105+
require "bundler/setup"
1106+
Object.new.gem "rack"
1107+
puts Gem.loaded_specs["rack"].full_name
1108+
RUBY
1109+
expect(out).to eq("rack-1.0.0")
1110+
end
1111+
end
10971112
end

0 commit comments

Comments
 (0)