summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-24 13:00:30 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:59 +0900
commit1fbd6a1fe0e298aef006cf1aa41e6e6f1ce7c7c5 (patch)
treef3ca1cc26bef147e48564459b1d0cd1c813e8438
parent1069139a339a6a7d0d6169c634e572659f749ea9 (diff)
[bundler/bundler] Move `strict` to an attribute
Co-authored-by: Guillermo Guerrero <wolf.fox1985@gmail.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> https://github.com/bundler/bundler/commit/7b68d86bdd
-rw-r--r--lib/bundler/cli/outdated.rb16
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