diff options
author | David RodrÃguez <[email protected]> | 2024-09-20 15:37:52 +0200 |
---|---|---|
committer | git <[email protected]> | 2024-09-23 10:37:57 +0000 |
commit | c071fedb320d8e7c9edc3087a3386895d59c6100 (patch) | |
tree | 512e31f342c5d0ca576d38cf6c9bad36ec21ea89 /lib/bundler/cli/outdated.rb | |
parent | 7be1fafe58e2baaa1da4dcd6f4854e674f9d3100 (diff) |
[rubygems/rubygems] Fix `bundle outdated` with `--group` option
It was printing incorrect output and returning incorrect status.
https://github.com/rubygems/rubygems/commit/96f5979c7d
Diffstat (limited to 'lib/bundler/cli/outdated.rb')
-rw-r--r-- | lib/bundler/cli/outdated.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 64a83fd57e..75fcdca641 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -97,28 +97,26 @@ module Bundler } end - if outdated_gems.empty? + relevant_outdated_gems = if options_include_groups + outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems| + contains_group = groups.split(", ").include?(options[:group]) + next unless options[:groups] || contains_group + + gems + end.compact + else + outdated_gems + end + + if relevant_outdated_gems.empty? unless options[:parseable] Bundler.ui.info(nothing_outdated_message) end else - if options_include_groups - relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems| - contains_group = groups.split(", ").include?(options[:group]) - next unless options[:groups] || contains_group - - gems - end.compact - - if options[:parseable] - print_gems(relevant_outdated_gems) - else - print_gems_table(relevant_outdated_gems) - end - elsif options[:parseable] - print_gems(outdated_gems) + if options[:parseable] + print_gems(relevant_outdated_gems) else - print_gems_table(outdated_gems) + print_gems_table(relevant_outdated_gems) end exit 1 |