From 7b68d86bddaf40530bbb0957e8631716c4b46566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Jul 2019 13:00:30 +0200 Subject: Move `strict` to an attribute 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 --- lib/bundler/cli/outdated.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index ad58be0b9f..e35031a4ff 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -2,7 +2,7 @@ module Bundler class CLI::Outdated - attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources + attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict attr_accessor :outdated_gems_by_groups, :outdated_gems_list def initialize(options, gems) @@ -19,6 +19,11 @@ module Bundler @options_include_groups = [:group, :groups].any? do |v| options.keys.include?(v.to_s) end + + # the patch level options imply strict is also true. It wouldn't make + # sense otherwise. + @strict = options["filter-strict"] || + Bundler::CLI::Common.patch_level_options(options).any? end def run @@ -47,11 +52,6 @@ module Bundler options ) - # the patch level options imply strict is also true. It wouldn't make - # sense otherwise. - strict = options["filter-strict"] || - Bundler::CLI::Common.patch_level_options(options).any? - definition_resolution = proc do options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely! end @@ -79,7 +79,7 @@ module Bundler next if !gems.empty? && !gems.include?(current_spec.name) dependency = current_dependencies[current_spec.name] - active_spec = retrieve_active_spec(strict, definition, current_spec) + active_spec = retrieve_active_spec(definition, current_spec) next if active_spec.nil? next if filter_options_patch.any? && @@ -168,7 +168,7 @@ module Bundler end end - def retrieve_active_spec(strict, definition, current_spec) + def retrieve_active_spec(definition, current_spec) return unless current_spec.match_platform(Bundler.local_platform) if strict -- cgit v1.2.1