diff options
author | David Rodríguez <deivid.rodriguez@riseup.net> | 2019-07-24 13:00:30 +0200 |
---|---|---|
committer | David Rodríguez <deivid.rodriguez@riseup.net> | 2019-07-24 16:09:42 +0200 |
commit | 7b68d86bddaf40530bbb0957e8631716c4b46566 (patch) | |
tree | 3bfb36681c79d131bf5b5ec30393ed5f24af798e | |
parent | 027aba0cfff0214f69eee4e1636e9ef90a40488b (diff) | |
download | bundler-7b68d86bddaf40530bbb0957e8631716c4b46566.tar.gz |
Move `strict` to an attribute
Co-authored-by: Guillermo Guerrero <wolf.fox1985@gmail.com>
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | lib/bundler/cli/outdated.rb | 16 |
1 files 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 |