From b7bc8d4b22273aa45c08f4eb111e3f5c36d78065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 24 Sep 2019 16:22:05 +0200 Subject: Remove unnecessary `outdated_gems_by_groups` --- lib/bundler/cli/outdated.rb | 8 ++------ 1 file 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 -- cgit v1.2.1