Skip to content

Commit 59a8538

Browse files
Remove extension building sync stuff no longer present in RubyGems
1 parent 929b521 commit 59a8538

File tree

4 files changed

+2
-35
lines changed

4 files changed

+2
-35
lines changed

bundler/lib/bundler/rubygems_integration.rb

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44

55
module Bundler
66
class RubygemsIntegration
7-
if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
8-
EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
9-
else
10-
require "monitor"
7+
require "monitor"
118

12-
EXT_LOCK = Monitor.new
13-
end
9+
EXT_LOCK = Monitor.new
1410

1511
def initialize
1612
@replaced_methods = {}
17-
backport_ext_builder_monitor
1813
end
1914

2015
def version
@@ -479,25 +474,6 @@ def all_specs
479474
end
480475
end
481476

482-
def backport_ext_builder_monitor
483-
# So we can avoid requiring "rubygems/ext" in its entirety
484-
Gem.module_eval <<-RUBY, __FILE__, __LINE__ + 1
485-
module Ext
486-
end
487-
RUBY
488-
489-
require "rubygems/ext/builder"
490-
491-
Gem::Ext::Builder.class_eval do
492-
unless const_defined?(:CHDIR_MONITOR)
493-
const_set(:CHDIR_MONITOR, EXT_LOCK)
494-
end
495-
496-
remove_const(:CHDIR_MUTEX) if const_defined?(:CHDIR_MUTEX)
497-
const_set(:CHDIR_MUTEX, const_get(:CHDIR_MONITOR))
498-
end
499-
end
500-
501477
def find_bundler(version)
502478
find_name("bundler").find {|s| s.version.to_s == version }
503479
end

bundler/spec/bundler/plugin/installer_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
describe "cli install" do
77
it "uses Gem.sources when non of the source is provided" do
88
sources = double(:sources)
9-
Bundler.settings # initialize it before we have to touch rubygems.ext_lock
109
allow(Gem).to receive(:sources) { sources }
1110

1211
allow(installer).to receive(:install_rubygems).

bundler/spec/bundler/rubygems_integration_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Bundler::RubygemsIntegration do
4-
it "uses the same chdir lock as rubygems" do
5-
expect(Bundler.rubygems.ext_lock).to eq(Gem::Ext::Builder::CHDIR_MONITOR)
6-
end
7-
84
context "#validate" do
95
let(:spec) do
106
Gem::Specification.new do |s|

bundler/spec/bundler/shared_helpers_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Bundler::SharedHelpers do
4-
let(:ext_lock_double) { double(:ext_lock) }
5-
64
before do
75
pwd_stub
8-
allow(Bundler.rubygems).to receive(:ext_lock).and_return(ext_lock_double)
9-
allow(ext_lock_double).to receive(:synchronize) {|&block| block.call }
106
end
117

128
let(:pwd_stub) { allow(subject).to receive(:pwd).and_return(bundled_app) }

0 commit comments

Comments
 (0)