diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-04-30 17:43:29 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-04-30 17:43:29 -0700 |
commit | b5a9a2b14414417bf1441258ce4bf68569b6cb42 (patch) | |
tree | 764ed8418ccd0698dbf4fbb4edff75b1272d429f /lib | |
parent | 67620e0a5910cb31bb0f0569ea325598cda93057 (diff) | |
download | bundler-b5a9a2b14414417bf1441258ce4bf68569b6cb42.tar.gz |
[RubyGemsIntegration] Use .stubs_for when available
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index bbfd1b4f..047aa891 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 |