summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/outdated.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2019-07-24 13:34:52 +0200
committerHiroshi SHIBATA <[email protected]>2019-08-03 09:29:59 +0900
commita42478502c923978a0cf14e7e00efbc0149b07a9 ()
treeb7dbab3b213ce74d62c889351e8e270f14a75e9a /lib/bundler/cli/outdated.rb
parent4e76aef280f8440a9e499a05a2d74e6f2ba7cdd6 (diff)
[bundler/bundler] Move `any?` logic to the attribute
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 <[email protected]> Co-authored-by: David Rodríguez <[email protected]> https://.com/bundler/bundler/commit/53c0fae760
-rw-r--r--lib/bundler/cli/outdated.rb8
1 files changed, 3 insertions, 5 deletions
@@ -8,7 +8,7 @@ module Bundler
@options = options
@gems = gems
- @options_include_groups = [:group, :groups].select do |v|
options.keys.include?(v.to_s)
end
end
@@ -119,7 +119,7 @@ module Bundler
end
end
- if options_include_groups.any?
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)
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}"