Skip to content

Commit 56841bb

Browse files
committed
Fix outdated check with platform fallback specs
1 parent 564bb9e commit 56841bb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bundler/lib/bundler/cli/outdated.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def run
7777
gemfile_specs + dependency_specs
7878
end
7979

80-
specs.sort_by(&:name).uniq(&:name).each do |current_spec|
80+
specs_for_outdated_check(specs).each do |current_spec|
8181
next unless gems.empty? || gems.include?(current_spec.name)
8282

8383
active_spec = retrieve_active_spec(definition, current_spec)
@@ -152,6 +152,12 @@ def nothing_outdated_message
152152
end
153153
end
154154

155+
def specs_for_outdated_check(specs)
156+
specs.group_by(&:name).values.filter_map do |matching_specs|
157+
MatchPlatform.select_best_platform_match(matching_specs, Bundler.local_platform).first || matching_specs.first
158+
end.sort_by(&:name)
159+
end
160+
155161
def retrieve_active_spec(definition, current_spec)
156162
active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
157163
return unless active_spec

0 commit comments

Comments
 (0)