summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-04-30 17:43:29 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-04-30 17:43:29 -0700
commitb5a9a2b14414417bf1441258ce4bf68569b6cb42 (patch)
tree764ed8418ccd0698dbf4fbb4edff75b1272d429f
parent67620e0a5910cb31bb0f0569ea325598cda93057 (diff)
downloadbundler-seg-stubs-for.tar.gz
[RubyGemsIntegration] Use .stubs_for when availableseg-stubs-for
-rw-r--r--lib/bundler/rubygems_integration.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index bbfd1b4fe4..047aa891a6 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -607,10 +607,16 @@ module Bundler
Gem::Ext::Builder::CHDIR_MONITOR
end
- def find_name(name)
- Gem::Specification.stubs.find_all do |spec|
- spec.name == name
- end.map(&:to_spec)
+ if Gem::Specification.respond_to?(:stubs_for)
+ def find_name(name)
+ Gem::Specification.stubs_for(name).map(&:to_spec)
+ end
+ else
+ def find_name(name)
+ Gem::Specification.stubs.find_all do |spec|
+ spec.name == name
+ end.map(&:to_spec)
+ end
end
end