summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-05-28 21:27:41 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-05-28 21:27:41 -0700
commitb4d2b086d40b7f9daa1a2007a7a378f30ac661b4 (patch)
tree3888e378417c0ec24da53277a19f898448804a19
parentd167069306f01d79ff290f121f5d8320f1b2f8c7 (diff)
parent8d6b640315a55f11be94e31ea416fd798bdda707 (diff)
downloadbundler-b4d2b086d40b7f9daa1a2007a7a378f30ac661b4.tar.gz
Merge pull request #3682 from bundler/seg-fix-chdir
[RubyGemsIntegration] Check for chdir monitor after its been backported
-rw-r--r--lib/bundler/rubygems_integration.rb4
-rw-r--r--spec/bundler/rubygems_integration_spec.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index b134e06c1c..6d6f2ab9a7 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -614,13 +614,13 @@ module Bundler
Gem::Ext::Builder.class_eval do
if !const_defined?(:CHDIR_MONITOR)
- const_set(:CHDIR_MONITOR, Monitor.new)
+ const_set(:CHDIR_MONITOR, EXT_LOCK)
end
if const_defined?(:CHDIR_MUTEX)
remove_const(:CHDIR_MUTEX)
- const_set(:CHDIR_MUTEX, const_get(:CHDIR_MONITOR))
end
+ const_set(:CHDIR_MUTEX, const_get(:CHDIR_MONITOR))
end
end
diff --git a/spec/bundler/rubygems_integration_spec.rb b/spec/bundler/rubygems_integration_spec.rb
new file mode 100644
index 0000000000..0317bec795
--- /dev/null
+++ b/spec/bundler/rubygems_integration_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe Bundler::RubygemsIntegration do
+ it "uses the same chdir lock as rubygems", :rubygems => "2.1" do
+ expect(Bundler.rubygems.ext_lock).to eq(Gem::Ext::Builder::CHDIR_MONITOR)
+ end
+end