diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 12:47:12 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 12:47:12 +0900 |
commit | 1ada1b737ba06af402cd9bb3d9d870761a0f649c (patch) | |
tree | 2232211bd7591bed60da1983eb927987e43b1c68 | |
parent | 6cc2fbe7dc7f089d13381922e082f7c119e4dd77 (diff) | |
download | bundler-1ada1b737ba06af402cd9bb3d9d870761a0f649c.tar.gz |
SpecGroup#to_specs doesn't return duplicated specs
-rw-r--r-- | lib/bundler/lazy_specification.rb | 8 | ||||
-rw-r--r-- | lib/bundler/resolver/spec_group.rb | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 32c8bb9557..7a6f5614ef 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -46,6 +46,14 @@ module Bundler identifier == other.identifier end + def eql?(other) + identifier.eql?(other.identifier) + end + + def hash + identifier.hash + end + def satisfies?(dependency) @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version)) end diff --git a/lib/bundler/resolver/spec_group.rb b/lib/bundler/resolver/spec_group.rb index 4ebb747956..d5d12f7a2d 100644 --- a/lib/bundler/resolver/spec_group.rb +++ b/lib/bundler/resolver/spec_group.rb @@ -29,7 +29,7 @@ module Bundler lazy_spec = LazySpecification.new(name, version, s.platform, source) lazy_spec.dependencies.replace s.dependencies lazy_spec - end.compact + end.compact.uniq end def activate_platform!(platform) |