diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-06-10 19:46:05 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-15 21:20:37 +0900 |
commit | 955f1837a180d8936f90ab6cf039ccb8f751be72 (patch) | |
tree | 0d48749501febfccefda3b1376511c421d4118e4 /lib/rubygems/commands | |
parent | ef481c120c55bf0351a586739f9b5d704f3f7a7d (diff) | |
download | ruby-955f1837a180d8936f90ab6cf039ccb8f751be72.tar.gz |
Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/cert_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/cleanup_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/contents_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/dependency_command.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/commands/fetch_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/help_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/lock_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/stale_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/uninstall_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/unpack_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 8 |
13 files changed, 27 insertions, 27 deletions
diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb index 72400f3edd..4ec600e17a 100644 --- a/lib/rubygems/commands/cert_command.rb +++ b/lib/rubygems/commands/cert_command.rb @@ -186,7 +186,7 @@ class Gem::Commands::CertCommand < Gem::Command subject = certificate.subject.to_s subject.downcase.index filter end.sort_by do |certificate, _| - certificate.subject.to_a.map { |name, data,| [name, data] } + certificate.subject.to_a.map {|name, data,| [name, data] } end.each do |certificate, path| yield certificate, path end diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index fedaec8448..98cd203208 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -69,7 +69,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 + this_set = @gems_to_cleanup.map {|spec| spec.full_name }.sort done = this_set.empty? || last_set == this_set @@ -82,7 +82,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.map {|spec| spec.full_name } "Skipped default gems: #{skipped.join ', '}" end @@ -99,7 +99,7 @@ If no gems are named all gems in GEM_HOME are cleaned. @full = Gem::DependencyList.from_specs deplist = Gem::DependencyList.new - @gems_to_cleanup.each { |spec| deplist.add spec } + @gems_to_cleanup.each {|spec| deplist.add spec } deps = deplist.strongly_connected_components.flatten diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index 2da8c49031..d30b62d43c 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -175,7 +175,7 @@ prefix or only the files that are requireable. if Gem.configuration.verbose say "\nDirectories searched:" - @spec_dirs.sort.each { |dir| say dir } + @spec_dirs.sort.each {|dir| say dir } end return nil diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index 00ab19bed4..bdb71adc3c 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -59,14 +59,14 @@ use with other commands. ss, = fetcher.spec_for_dependency dependency - ss.map { |spec, _| spec } + ss.map {|spec, _| spec } end def fetch_specs(name_pattern, dependency) # :nodoc: specs = [] if local? - specs.concat Gem::Specification.stubs.find_all { |spec| + specs.concat Gem::Specification.stubs.find_all {|spec| name_pattern =~ spec.name and dependency.requirement.satisfied_by? spec.version }.map(&:to_spec) @@ -92,7 +92,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| + spec.dependencies.sort_by {|dep| dep.name }.each do |dep| say "#{dep.name} --version '#{dep.requirement}'" end end @@ -156,7 +156,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| + spec.dependencies.sort_by {|dep| dep.name }.each do |dep| response << ' ' * level + " #{dep}\n" end end @@ -168,11 +168,11 @@ use with other commands. ss, _ = fetcher.spec_for_dependency dependency - ss.map { |s,o| s } + ss.map {|s,o| s } end def reverse_dependencies(specs) # :nodoc: - reverse = Hash.new { |h, k| h[k] = [] } + reverse = Hash.new {|h, k| h[k] = [] } return reverse unless options[:reverse_dependencies] diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb index 66562d7fb7..ab77a3b26a 100644 --- a/lib/rubygems/commands/fetch_command.rb +++ b/lib/rubygems/commands/fetch_command.rb @@ -57,11 +57,11 @@ then repackaging it. Gem::SpecFetcher.fetcher.spec_for_dependency dep if platform - filtered = specs_and_sources.select { |s,| s.platform == platform } + filtered = specs_and_sources.select {|s,| s.platform == platform } specs_and_sources = filtered unless filtered.empty? end - spec, source = specs_and_sources.max_by { |s,| s.version } + spec, source = specs_and_sources.max_by {|s,| s.version } if spec.nil? show_lookup_failure gem_name, version, errors, options[:domain] diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb index 259e8b5622..23df79f6ce 100644 --- a/lib/rubygems/commands/help_command.rb +++ b/lib/rubygems/commands/help_command.rb @@ -324,7 +324,7 @@ platform. margin_width = 4 - desc_width = @command_manager.command_names.map { |n| n.size }.max + 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) diff --git a/lib/rubygems/commands/lock_command.rb b/lib/rubygems/commands/lock_command.rb index ebb402a8bd..ed1d5489b7 100644 --- a/lib/rubygems/commands/lock_command.rb +++ b/lib/rubygems/commands/lock_command.rb @@ -104,7 +104,7 @@ lock it down to the exact version. File.join path, "specifications", "#{gem_full_name}.gemspec" end - gemspecs.find { |path| File.exist? path } + gemspecs.find {|path| File.exist? path } end end diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index a82b6a44aa..55b80619bd 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -217,7 +217,7 @@ By default, this RubyGems will install gem as: say say "RubyGems installed the following executables:" - say bin_file_names.map { |name| "\t#{name}\n" } + say bin_file_names.map {|name| "\t#{name}\n" } say unless bin_file_names.grep(/#{File::SEPARATOR}gem$/) @@ -548,7 +548,7 @@ By default, this RubyGems will install gem as: def bundler_template_files Dir.chdir "bundler/lib" do Dir.glob(File.join('bundler', 'templates', '**', '*'), File::FNM_DOTMATCH). - select{|f| !File.directory?(f)} + select{|f| !File.directory?(f) } end end @@ -556,7 +556,7 @@ By default, this RubyGems will install gem as: def template_files_in(dir) Dir.chdir dir do Dir.glob(File.join('templates', '**', '*'), File::FNM_DOTMATCH). - select{|f| !File.directory?(f)} + select{|f| !File.directory?(f) } end end diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index 7326822ad7..e19bfeed73 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -119,7 +119,7 @@ Specific fields in the specification can be extracted in YAML format: dep.prerelease = options[:prerelease] found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep - specs.push(*found.map { |spec,| spec }) + specs.push(*found.map {|spec,| spec }) end if specs.empty? @@ -128,7 +128,7 @@ Specific fields in the specification can be extracted in YAML format: end unless options[:all] - specs = [specs.max_by { |s| s.version }] + specs = [specs.max_by {|s| s.version }] end specs.each do |s| diff --git a/lib/rubygems/commands/stale_command.rb b/lib/rubygems/commands/stale_command.rb index 89bafeae98..2fd4388891 100644 --- a/lib/rubygems/commands/stale_command.rb +++ b/lib/rubygems/commands/stale_command.rb @@ -33,7 +33,7 @@ longer using. end end - gem_to_atime.sort_by { |_, atime| atime }.each do |name, atime| + gem_to_atime.sort_by {|_, atime| atime }.each do |name, atime| say "#{name} at #{atime.strftime '%c'}" end end diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb index c1a9dbba32..2aac9e975e 100644 --- a/lib/rubygems/commands/uninstall_command.rb +++ b/lib/rubygems/commands/uninstall_command.rb @@ -136,7 +136,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 = Gem::Specification.reject {|spec| spec.default_gem? } specs.each do |spec| options[:version] = spec.version diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb index 09829d873c..1091a55f37 100644 --- a/lib/rubygems/commands/unpack_command.rb +++ b/lib/rubygems/commands/unpack_command.rb @@ -157,7 +157,7 @@ command help for an example. specs = dependency.matching_specs - selected = specs.max_by { |s| s.version } + selected = specs.max_by {|s| s.version } return Gem::RemoteFetcher.fetcher.download_to_cache(dependency) unless selected diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 494b3eef67..ca407ee33e 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -107,7 +107,7 @@ command to remove old versions. updated = update_gems gems_to_update - updated_names = updated.map { |spec| spec.name } + updated_names = updated.map {|spec| spec.name } not_updated_names = options[:args].uniq - updated_names if updated.empty? @@ -126,7 +126,7 @@ command to remove old versions. spec_tuples, errors = fetcher.search_for_dependency dependency - error = errors.find { |e| e.respond_to? :exception } + error = errors.find {|e| e.respond_to? :exception } raise error if error @@ -231,7 +231,7 @@ command to remove old versions. end def update_gem(name, version = Gem::Requirement.default) - return if @updated.any? { |spec| spec.name == name } + return if @updated.any? {|spec| spec.name == name } update_options = options.dup update_options[:prerelease] = version.prerelease? @@ -292,7 +292,7 @@ command to remove old versions. highest_installed_gems.each do |l_name, l_spec| next if not gem_names.empty? and - gem_names.none? { |name| name == l_spec.name } + gem_names.none? {|name| name == l_spec.name } highest_remote_tup = highest_remote_name_tuple l_spec highest_remote_ver = highest_remote_tup.version |