ruby-changes:70927
From: David <ko1@a...>
Date: Wed, 19 Jan 2022 11:21:05 +0900 (JST)
Subject: [ruby-changes:70927] f04954d95c (master): [rubygems/rubygems] Normalize end alignment style with Bundler
https://git.ruby-lang.org/ruby.git/commit/?id=f04954d95c From f04954d95c8a729d70be1c883617534a2e7cc239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 17 Jan 2022 15:16:34 +0100 Subject: [rubygems/rubygems] Normalize end alignment style with Bundler https://github.com/rubygems/rubygems/commit/f7f504b24c --- lib/rubygems/basic_specification.rb | 16 ++--- lib/rubygems/bundler_version_finder.rb | 6 +- lib/rubygems/command.rb | 8 +-- lib/rubygems/commands/cleanup_command.rb | 12 ++-- lib/rubygems/commands/pristine_command.rb | 24 +++---- lib/rubygems/commands/push_command.rb | 16 ++--- lib/rubygems/commands/rdoc_command.rb | 12 ++-- lib/rubygems/commands/setup_command.rb | 16 ++--- lib/rubygems/commands/specification_command.rb | 8 +-- lib/rubygems/commands/update_command.rb | 8 +-- lib/rubygems/config_file.rb | 8 +-- lib/rubygems/doctor.rb | 10 +-- lib/rubygems/gem_runner.rb | 10 +-- lib/rubygems/install_update_options.rb | 8 +-- lib/rubygems/package.rb | 20 +++--- lib/rubygems/platform.rb | 84 ++++++++++++------------ lib/rubygems/query_utils.rb | 12 ++-- lib/rubygems/remote_fetcher.rb | 8 +-- lib/rubygems/request_set/lockfile.rb | 8 +-- lib/rubygems/source.rb | 12 ++-- lib/rubygems/source_list.rb | 14 ++-- lib/rubygems/spec_fetcher.rb | 50 +++++++------- lib/rubygems/specification.rb | 90 +++++++++++++------------- lib/rubygems/specification_policy.rb | 32 ++++----- lib/rubygems/stub_specification.rb | 30 ++++----- lib/rubygems/uninstaller.rb | 14 ++-- lib/rubygems/user_interaction.rb | 24 +++---- lib/rubygems/version.rb | 12 ++-- test/rubygems/helper.rb | 8 +-- test/rubygems/utilities.rb | 8 +-- 30 files changed, 294 insertions(+), 294 deletions(-) diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index 665b87fc0e3..b3b63b51aae 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -289,14 +289,14 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L289 def lib_dirs_glob dirs = if self.raw_require_paths - if self.raw_require_paths.size > 1 - "{#{self.raw_require_paths.join(',')}}" - else - self.raw_require_paths.first - end - else - "lib" # default value for require_paths for bundler/inline - end + if self.raw_require_paths.size > 1 + "{#{self.raw_require_paths.join(',')}}" + else + self.raw_require_paths.first + end + else + "lib" # default value for require_paths for bundler/inline + end "#{self.full_gem_path}/#{dirs}".dup.tap(&Gem::UNTAINT) end diff --git a/lib/rubygems/bundler_version_finder.rb b/lib/rubygems/bundler_version_finder.rb index 14179aebf34..f6fad0bd83f 100644 --- a/lib/rubygems/bundler_version_finder.rb +++ b/lib/rubygems/bundler_version_finder.rb @@ -65,9 +65,9 @@ module Gem::BundlerVersionFinder https://github.com/ruby/ruby/blob/trunk/lib/rubygems/bundler_version_finder.rb#L65 return unless gemfile lockfile = case gemfile - when "gems.rb" then "gems.locked" - else "#{gemfile}.lock" - end.dup.tap(&Gem::UNTAINT) + when "gems.rb" then "gems.locked" + else "#{gemfile}.lock" + end.dup.tap(&Gem::UNTAINT) return unless File.file?(lockfile) diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index abdaa8e7c60..f74cb419f9c 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -398,10 +398,10 @@ class Gem::Command https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command.rb#L398 version_to_expire = deprecation["rg_version_to_expire"] deprecate_option_msg = if version_to_expire - "The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}." - else - "The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems." - end + "The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}." + else + "The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems." + end extra_msg = deprecation["extra_msg"] diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index c965085880f..dc181e4de04 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. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/cleanup_command.rb#L117 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 13979b0a590..3cf496ba5b8 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -98,20 +98,20 @@ extensions will be restored. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/pristine_command.rb#L98 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 1864b4b0957..4d0d5a9f4b5 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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/push_command.rb#L52 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 305c80ccfef..7c5d6212f5b 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. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/rdoc_command.rb#L61 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 0601dccb075..01714f0342f 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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L54 '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 t (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/