diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-01-17 15:16:34 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-01-19 11:20:36 +0900 |
commit | f04954d95c8a729d70be1c883617534a2e7cc239 (patch) | |
tree | 61146129066534cd6c29895ab45869f351be9640 /lib/rubygems/commands | |
parent | a892e5599ec8ec441a8d8b878efa855ef283ed08 (diff) |
[rubygems/rubygems] Normalize end alignment style with Bundler
https://github.com/rubygems/rubygems/commit/f7f504b24c
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/cleanup_command.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 24 | ||||
-rw-r--r-- | lib/rubygems/commands/push_command.rb | 16 | ||||
-rw-r--r-- | lib/rubygems/commands/rdoc_command.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 16 | ||||
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 8 | ||||
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 8 |
7 files changed, 48 insertions, 48 deletions
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index c965085880..dc181e4de0 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -117,12 +117,12 @@ If no gems are named all gems in GEM_HOME are cleaned. def get_candidate_gems @candidate_gems = unless options[:args].empty? - options[:args].map do |gem_name| - Gem::Specification.find_all_by_name gem_name - end.flatten - else - Gem::Specification.to_a - end + options[:args].map do |gem_name| + Gem::Specification.find_all_by_name gem_name + end.flatten + else + Gem::Specification.to_a + end end def get_gems_to_cleanup diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index 13979b0a59..3cf496ba5b 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -98,20 +98,20 @@ extensions will be restored. def execute specs = if options[:all] - Gem::Specification.map + Gem::Specification.map - # `--extensions` must be explicitly given to pristine only gems - # with extensions. - elsif options[:extensions_set] and + # `--extensions` must be explicitly given to pristine only gems + # with extensions. + elsif options[:extensions_set] and options[:extensions] and options[:args].empty? - Gem::Specification.select do |spec| - spec.extensions and not spec.extensions.empty? - end - else - get_all_gem_names.sort.map do |gem_name| - Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse - end.flatten - end + Gem::Specification.select do |spec| + spec.extensions and not spec.extensions.empty? + end + else + get_all_gem_names.sort.map do |gem_name| + Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse + end.flatten + end specs = specs.select{|spec| RUBY_ENGINE == spec.platform || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY } diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb index 1864b4b095..4d0d5a9f4b 100644 --- a/lib/rubygems/commands/push_command.rb +++ b/lib/rubygems/commands/push_command.rb @@ -52,14 +52,14 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo default_gem_server, push_host = get_hosts_for(gem_name) @host = if @user_defined_host - options[:host] - elsif default_gem_server - default_gem_server - elsif push_host - push_host - else - options[:host] - end + options[:host] + elsif default_gem_server + default_gem_server + elsif push_host + push_host + else + options[:host] + end sign_in @host, scope: get_push_scope diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb index 305c80ccfe..7c5d6212f5 100644 --- a/lib/rubygems/commands/rdoc_command.rb +++ b/lib/rubygems/commands/rdoc_command.rb @@ -61,12 +61,12 @@ Use --overwrite to force rebuilding of documentation. def execute specs = if options[:all] - Gem::Specification.to_a - else - get_all_gem_names.map do |name| - Gem::Specification.find_by_name name, options[:version] - end.flatten.uniq - end + Gem::Specification.to_a + else + get_all_gem_names.map do |name| + Gem::Specification.find_by_name name, options[:version] + end.flatten.uniq + end if specs.empty? alert_error 'No matching gems found' diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 0601dccb07..01714f0342 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -54,10 +54,10 @@ class Gem::Commands::SetupCommand < Gem::Command 'List the documentation types you wish to', 'generate. For example: rdoc,ri' do |value, options| options[:document] = case value - when nil then %w[rdoc ri] - when false then [] - else value - end + when nil then %w[rdoc ri] + when false then [] + else value + end end add_option '--[no-]rdoc', @@ -666,10 +666,10 @@ abort "#{deprecation_message}" def target_bin_path(bin_dir, bin_file) bin_file_formatted = if options[:format_executable] - Gem.default_exec_format % bin_file - else - bin_file - end + Gem.default_exec_format % bin_file + else + bin_file + end File.join bin_dir, bin_file_formatted end diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index 473b6e7b19..6f24787962 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -140,10 +140,10 @@ Specific fields in the specification can be extracted in YAML format: s = s.send field if field say case options[:format] - when :ruby then s.to_ruby - when :marshal then Marshal.dump s - else s.to_yaml - end + when :ruby then s.to_ruby + when :marshal then Marshal.dump s + else s.to_yaml + end say "\n" end diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 99208e5cb2..ecaf717871 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -233,10 +233,10 @@ command to remove old versions. up_ver = gems_to_update.first.version target = if update_latest - up_ver - else - version - end + up_ver + else + version + end return target, requirement end |