summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulian Nadeau <julian@jnadeau.ca>2017-04-18 15:56:56 -0400
committerJulian Nadeau <julian@jnadeau.ca>2017-04-18 19:57:07 -0400
commitf89408c10294749c3b1c83bc4da733aa3b546866 (patch)
tree42e9ed50498320edf6dfb294210c82033d2a9ff5 /lib
parentf153ef72f8572eee86e8b1672e29a6a206efb91a (diff)
downloadbundler-f89408c10294749c3b1c83bc4da733aa3b546866.tar.gz
Apply source to calculate stub spec extension
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/stub_specification.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index 257a472224..c0a8d92252 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -11,6 +11,18 @@ 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
+ end
+ end
+
def to_yaml
_remote_specification.to_yaml
end