diff options
author | Andre Arko <andre@arko.net> | 2010-10-27 15:43:29 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-10-27 15:46:05 -0700 |
commit | a9754098f61a36d2ef37f844032575d6b706c452 (patch) | |
tree | f4144e4d9f0f9ff50ed40989cc3a450d949efe3e /lib/bundler/rubygems_ext.rb | |
parent | 0fe1389d5f90109c5a0103dea9ced329df22af9e (diff) | |
download | bundler-a9754098f61a36d2ef37f844032575d6b706c452.tar.gz |
Handle RUBY (a string, not a Gem::Platform)
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index e19a76c599..220af2a991 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -177,11 +177,14 @@ module Bundler ] def generic(p) - if p == Gem::Platform::RUBY - return p - end + return p if p == Gem::Platform::RUBY - GENERIC_CACHE[p] ||= GENERICS.find { |p2| p.respond_to? :os ? p.os == p2.os : p == p2 } || Gem::Platform::RUBY + GENERIC_CACHE[p] ||= begin + found = GENERICS.find do |p2| + p.os == p2.os if p2.is_a?(Gem::Platform) + end + found || Gem::Platform::RUBY + end end end |