diff options
Diffstat (limited to 'lib/rubygems/dependency.rb')
-rw-r--r-- | lib/rubygems/dependency.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index 5924d2fc6b..b4a6dd8673 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -164,6 +164,10 @@ class Gem::Dependency @type ||= :runtime end + def runtime? + @type == :runtime || !@type + end + def == other # :nodoc: Gem::Dependency === other && self.name == other.name && @@ -270,9 +274,8 @@ class Gem::Dependency end def matching_specs platform_only = false - matches = Gem::Specification.stubs.find_all { |spec| - self.name === spec.name and # TODO: == instead of === - requirement.satisfied_by? spec.version + matches = Gem::Specification.stubs_for(name).find_all { |spec| + requirement.satisfied_by? spec.version }.map(&:to_spec) if platform_only |