summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-03-16 12:57:49 +0900
committerHiroshi SHIBATA <[email protected]>2023-03-17 18:50:55 +0900
commit5211900d37573a82c1bdf7cb2354937cc4022ae1 ()
tree4951c15df9b302437b4ff173fe30fb5e211bd1fb /lib/rubygems/commands
parentb304cf324aed40977665ddcfcec7cc992feb949b (diff)
util/rubocop -A --only Style/SymbolProc
-rw-r--r--lib/rubygems/commands/cleanup_command.rb8
-rw-r--r--lib/rubygems/commands/dependency_command.rb4
-rw-r--r--lib/rubygems/commands/help_command.rb2
-rw-r--r--lib/rubygems/commands/pristine_command.rb4
-rw-r--r--lib/rubygems/commands/specification_command.rb2
-rw-r--r--lib/rubygems/commands/uninstall_command.rb2
-rw-r--r--lib/rubygems/commands/unpack_command.rb2
-rw-r--r--lib/rubygems/commands/update_command.rb2
8 files changed, 11 insertions, 15 deletions
@@ -74,7 +74,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
until done do
clean_gems
- this_set = @gems_to_cleanup.map {|spec| spec.full_name }.sort
done = this_set.empty? || last_set == this_set
@@ -87,7 +87,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
say "Clean up complete"
verbose do
- skipped = @default_gems.map {|spec| spec.full_name }
"Skipped default gems: #{skipped.join ", "}"
end
@@ -130,9 +130,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
@primary_gems[spec.name].version != spec.version
end
- default_gems, gems_to_cleanup = gems_to_cleanup.partition do |spec|
- spec.default_gem?
- end
uninstall_from = options[:user_install] ? Gem.user_dir : @original_home
@@ -90,7 +90,7 @@ use with other commands.
def display_pipe(specs) # :nodoc:
specs.each do |spec|
unless spec.dependencies.empty?
- spec.dependencies.sort_by {|dep| dep.name }.each do |dep|
say "#{dep.name} --version '#{dep.requirement}'"
end
end
@@ -152,7 +152,7 @@ use with other commands.
response = String.new
response << " " * level + "Gem #{spec.full_name}\n"
unless spec.dependencies.empty?
- spec.dependencies.sort_by {|dep| dep.name }.each do |dep|
response << " " * level + " #{dep}\n"
end
end
@@ -323,7 +323,7 @@ platform.
margin_width = 4
- desc_width = @command_manager.command_names.map {|n| n.size }.max + 4
summary_width = 80 - margin_width - desc_width
wrap_indent = " " * (margin_width + desc_width)
@@ -113,9 +113,7 @@ extensions will be restored.
spec.extensions && !spec.extensions.empty?
end
elsif options[:only_missing_extensions]
- Gem::Specification.select do |spec|
- spec.missing_extensions?
- end
else
get_all_gem_names.sort.map do |gem_name|
Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
@@ -137,7 +137,7 @@ Specific fields in the specification can be extracted in YAML format:
end
unless options[:all]
- specs = [specs.max_by {|s| s.version }]
end
specs.each do |s|
@@ -137,7 +137,7 @@ that is a dependency of an existing gem. You can use the
end
def uninstall_all
- specs = Gem::Specification.reject {|spec| spec.default_gem? }
specs.each do |spec|
options[:version] = spec.version
@@ -154,7 +154,7 @@ command help for an example.
specs = dependency.matching_specs
- selected = specs.max_by {|s| s.version }
return Gem::RemoteFetcher.fetcher.download_to_cache(dependency) unless
selected
@@ -119,7 +119,7 @@ command to remove old versions.
updated = update_gems gems_to_update
installed_names = highest_installed_gems.keys
- updated_names = updated.map {|spec| spec.name }
not_updated_names = options[:args].uniq - updated_names
not_installed_names = not_updated_names - installed_names
up_to_date_names = not_updated_names - not_installed_names