From a42478502c923978a0cf14e7e00efbc0149b07a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Jul 2019 13:34:52 +0200 Subject: [PATCH] [bundler/bundler] Move `any?` logic to the attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's the only usage of the `options_include_groups` attribute and its name suggests a boolean, so it fits better now. Co-authored-by: Guillermo Guerrero Co-authored-by: David Rodríguez https://github.com/bundler/bundler/commit/53c0fae760 --- lib/bundler/cli/outdated.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 4fa41a7a6f..edff072199 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -8,7 +8,7 @@ module Bundler @options = options @gems = gems - @options_include_groups = [:group, :groups].select do |v| + @options_include_groups = [:group, :groups].any? do |v| options.keys.include?(v.to_s) end end @@ -119,7 +119,7 @@ module Bundler end end - if options_include_groups.any? + if options_include_groups ordered_groups = outdated_gems_by_groups.keys.compact.sort [nil, ordered_groups].flatten.each do |groups| gems = outdated_gems_by_groups[groups] @@ -145,7 +145,6 @@ module Bundler gem[:active_spec], gem[:dependency], groups, - options_include_groups.any? ) end end @@ -156,7 +155,6 @@ module Bundler gem[:active_spec], gem[:dependency], gem[:groups], - options_include_groups.any? ) end end @@ -201,7 +199,7 @@ module Bundler end end - def print_gem(current_spec, active_spec, dependency, groups, options_include_groups) + def print_gem(current_spec, active_spec, dependency, groups) spec_version = "#{active_spec.version}#{active_spec.git_version}" spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from current_version = "#{current_spec.version}#{current_spec.git_version}"