summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulian Nadeau <julian@jnadeau.ca>2017-04-18 22:30:09 -0400
committerJulian Nadeau <julian@jnadeau.ca>2017-04-19 12:52:34 -0400
commitc1c2a9d82e14c7858055295c2967785e2d43eda5 (patch)
tree9727de7f6fc9af718bad5ff215ddb12f8af0ad2f /lib
parentf89408c10294749c3b1c83bc4da733aa3b546866 (diff)
downloadbundler-c1c2a9d82e14c7858055295c2967785e2d43eda5.tar.gz
Block for RubyGems > 2.2.0
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/stub_specification.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index c0a8d92252..7245860bbe 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -11,15 +11,17 @@ module Bundler
attr_accessor :stub, :ignored
- def source=(source)
- super
- # Stub has no concept of source, which means that extension_dir may be wrong
- # This is the case for git-based gems. So, instead manually assign the extension dir
- if source.respond_to?(:extension_dir_name)
- path = File.join(stub.extensions_dir, source.extension_dir_name)
- stub.extension_dir = File.expand_path(path)
- else
- stub.extension_dir = nil
+ # Pre 2.2.0 did not include extension_dir
+ # https://github.com/rubygems/rubygems/commit/9485ca2d101b82a946d6f327f4bdcdea6d4946ea
+ if Bundler.rubygems.provides?(">= 2.2.0")
+ def source=(source)
+ super
+ # Stub has no concept of source, which means that extension_dir may be wrong
+ # This is the case for git-based gems. So, instead manually assign the extension dir
+ if source.respond_to?(:extension_dir_name)
+ path = File.join(stub.extensions_dir, source.extension_dir_name)
+ stub.extension_dir = File.expand_path(path)
+ end
end
end