diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-09-24 16:22:05 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-09-25 11:02:07 +0200 |
commit | b7bc8d4b22273aa45c08f4eb111e3f5c36d78065 (patch) | |
tree | e956f311394f8c0d1ca172d8cebeae286ec6b64c | |
parent | 041271a0ae573584a98dc7a1b52a7cab8eadb71b (diff) | |
download | bundler-refactor_outdated.tar.gz |
Remove unnecessary `outdated_gems_by_groups`refactor_outdated
-rw-r--r-- | lib/bundler/cli/outdated.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 5c0da98325..2a2df4c26e 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -3,7 +3,7 @@ module Bundler class CLI::Outdated attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict - attr_accessor :outdated_gems_by_groups, :outdated_gems_list + attr_accessor :outdated_gems_list def initialize(options, gems) @options = options @@ -12,7 +12,6 @@ module Bundler @filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch] - @outdated_gems_by_groups = {} @outdated_gems_list = [] @options_include_groups = [:group, :groups].any? do |v| @@ -92,9 +91,6 @@ module Bundler :current_spec => current_spec, :dependency => dependency, :groups => groups } - - outdated_gems_by_groups[groups] ||= [] - outdated_gems_by_groups[groups] << outdated_gems_list[-1] end if outdated_gems_list.empty? @@ -105,7 +101,7 @@ module Bundler end if options_include_groups - outdated_gems_by_groups.sort.each do |groups, gems| + outdated_gems_list.group_by {|g| g[:groups] }.sort.each do |groups, gems| contains_group = groups.split(", ").include?(options[:group]) next unless options[:groups] || contains_group |