1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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>

7b68d86bdd
This commit is contained in:
David Rodríguez 2019-07-24 13:00:30 +02:00 committed by Hiroshi SHIBATA
parent 1069139a33
commit 1fbd6a1fe0
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -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