From fd3411c73f35e3e8c0e1cd72eea434ca6e8d1744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Jul 2019 13:38:47 +0200 Subject: [bundler/bundler] Move more locals to attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Guillermo Guerrero Co-authored-by: David Rodríguez https://github.com/bundler/bundler/commit/4335df3e4c --- lib/bundler/cli/outdated.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/bundler/cli') diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index edff072199..72f8e65a20 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -2,11 +2,19 @@ module Bundler class CLI::Outdated - attr_reader :options, :gems, :options_include_groups + attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources + attr_accessor :outdated_gems_by_groups, :outdated_gems_list def initialize(options, gems) @options = options @gems = gems + @sources = Array(options[:source]) + + @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| options.keys.include?(v.to_s) @@ -16,8 +24,6 @@ module Bundler def run check_for_deployment_mode - sources = Array(options[:source]) - gems.each do |gem_name| Bundler::CLI::Common.select_spec(gem_name) end @@ -48,9 +54,6 @@ module Bundler strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any? - filter_options_patch = options.keys & - %w[filter-major filter-minor filter-patch] - definition_resolution = proc do options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely! end @@ -62,8 +65,6 @@ module Bundler end Bundler.ui.info "" - outdated_gems_by_groups = {} - outdated_gems_list = [] # Loop through the current specs gemfile_specs, dependency_specs = current_specs.partition do |spec| @@ -108,7 +109,7 @@ module Bundler end if outdated_gems_list.empty? - display_nothing_outdated_message(filter_options_patch) + display_nothing_outdated_message else unless options[:parseable] if options[:pre] @@ -185,7 +186,7 @@ module Bundler active_spec end - def display_nothing_outdated_message(filter_options_patch) + def display_nothing_outdated_message unless options[:parseable] if filter_options_patch.any? display = filter_options_patch.map do |o| -- cgit v1.2.3