mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[bundler/bundler] Move more locals to attributes
Co-authored-by: Guillermo Guerrero <wolf.fox1985@gmail.com>
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
4335df3e4c
This commit is contained in:
parent
a42478502c
commit
fd3411c73f
1 changed files with 11 additions and 10 deletions
|
|
@ -2,11 +2,19 @@
|
||||||
|
|
||||||
module Bundler
|
module Bundler
|
||||||
class CLI::Outdated
|
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)
|
def initialize(options, gems)
|
||||||
@options = options
|
@options = options
|
||||||
@gems = gems
|
@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_include_groups = [:group, :groups].any? do |v|
|
||||||
options.keys.include?(v.to_s)
|
options.keys.include?(v.to_s)
|
||||||
|
|
@ -16,8 +24,6 @@ module Bundler
|
||||||
def run
|
def run
|
||||||
check_for_deployment_mode
|
check_for_deployment_mode
|
||||||
|
|
||||||
sources = Array(options[:source])
|
|
||||||
|
|
||||||
gems.each do |gem_name|
|
gems.each do |gem_name|
|
||||||
Bundler::CLI::Common.select_spec(gem_name)
|
Bundler::CLI::Common.select_spec(gem_name)
|
||||||
end
|
end
|
||||||
|
|
@ -48,9 +54,6 @@ module Bundler
|
||||||
strict = options["filter-strict"] ||
|
strict = options["filter-strict"] ||
|
||||||
Bundler::CLI::Common.patch_level_options(options).any?
|
Bundler::CLI::Common.patch_level_options(options).any?
|
||||||
|
|
||||||
filter_options_patch = options.keys &
|
|
||||||
%w[filter-major filter-minor filter-patch]
|
|
||||||
|
|
||||||
definition_resolution = proc do
|
definition_resolution = proc do
|
||||||
options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
|
options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
|
||||||
end
|
end
|
||||||
|
|
@ -62,8 +65,6 @@ module Bundler
|
||||||
end
|
end
|
||||||
|
|
||||||
Bundler.ui.info ""
|
Bundler.ui.info ""
|
||||||
outdated_gems_by_groups = {}
|
|
||||||
outdated_gems_list = []
|
|
||||||
|
|
||||||
# Loop through the current specs
|
# Loop through the current specs
|
||||||
gemfile_specs, dependency_specs = current_specs.partition do |spec|
|
gemfile_specs, dependency_specs = current_specs.partition do |spec|
|
||||||
|
|
@ -108,7 +109,7 @@ module Bundler
|
||||||
end
|
end
|
||||||
|
|
||||||
if outdated_gems_list.empty?
|
if outdated_gems_list.empty?
|
||||||
display_nothing_outdated_message(filter_options_patch)
|
display_nothing_outdated_message
|
||||||
else
|
else
|
||||||
unless options[:parseable]
|
unless options[:parseable]
|
||||||
if options[:pre]
|
if options[:pre]
|
||||||
|
|
@ -185,7 +186,7 @@ module Bundler
|
||||||
active_spec
|
active_spec
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_nothing_outdated_message(filter_options_patch)
|
def display_nothing_outdated_message
|
||||||
unless options[:parseable]
|
unless options[:parseable]
|
||||||
if filter_options_patch.any?
|
if filter_options_patch.any?
|
||||||
display = filter_options_patch.map do |o|
|
display = filter_options_patch.map do |o|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue