ruby-changes:62444
From: David <ko1@a...>
Date: Fri, 31 Jul 2020 21:08:09 +0900 (JST)
Subject: [ruby-changes:62444] a89665b7b1 (master): Enforce no empty lines around class body in rubygems
https://git.ruby-lang.org/ruby.git/commit/?id=a89665b7b1 From a89665b7b1abb5bb6005fd638dc920848cc50f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 13 Jul 2020 12:01:07 +0200 Subject: Enforce no empty lines around class body in rubygems To normalize the code style with `bundler`. diff --git a/lib/rubygems.rb b/lib/rubygems.rb index d24c07d..68b5061 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -1186,7 +1186,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L1186 # methods, and then we switch over to `class << self` here. Pick one or the # other. class << self - ## # RubyGems distributors (like operating system package managers) can # disable RubyGems update by setting this to error message printed to @@ -1309,7 +1308,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L1308 def default_gem_load_paths @default_gem_load_paths ||= $LOAD_PATH[load_path_insert_index..-1] end - end ## diff --git a/lib/rubygems/available_set.rb b/lib/rubygems/available_set.rb index 48bf6da..80ef29d 100644 --- a/lib/rubygems/available_set.rb +++ b/lib/rubygems/available_set.rb @@ -1,6 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/available_set.rb#L1 # frozen_string_literal: true class Gem::AvailableSet - include Enumerable Tuple = Struct.new(:spec, :source) @@ -162,5 +161,4 @@ class Gem::AvailableSet https://github.com/ruby/ruby/blob/trunk/lib/rubygems/available_set.rb#L161 def inject_into_list(dep_list) @set.each {|t| dep_list.add t.spec } end - end diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index ce07cdc..665b87f 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -4,7 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L4 # used by both Specification and StubSpecification. class Gem::BasicSpecification - ## # Allows installation of extensions for git: gems. @@ -39,10 +38,8 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L38 end class << self - extend Gem::Deprecate rubygems_deprecate :default_specifications_dir, "Gem.default_specifications_dir" - end ## @@ -345,5 +342,4 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L342 false end end - end diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index cfbe34c..bf55ce3 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -17,7 +17,6 @@ require_relative 'user_interaction' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command.rb#L17 # A very good example to look at is Gem::Commands::ContentsCommand class Gem::Command - include Gem::UserInteraction OptionParser.accept Symbol do |value| @@ -652,7 +651,6 @@ RubyGems is a package manager for Ruby. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command.rb#L651 HELP # :startdoc: - end ## diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index f18e777..1dcb577 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -32,7 +32,6 @@ require 'rubygems/text' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command_manager.rb#L32 # See Gem::Command for instructions on writing gem commands. class Gem::CommandManager - include Gem::Text include Gem::UserInteraction @@ -231,5 +230,4 @@ class Gem::CommandManager https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command_manager.rb#L230 ui.backtrace e end end - end diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index e2b5def..decdca0 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -3,7 +3,6 @@ require 'rubygems/command' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/build_command.rb#L3 require 'rubygems/package' class Gem::Commands::BuildCommand < Gem::Command - def initialize super 'build', 'Build a gem from a gemspec' @@ -108,5 +107,4 @@ Gems can be saved to a specified filename with the output option: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/build_command.rb#L107 terminate_interaction 1 end end - end diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb index 4ec600e..837cb95 100644 --- a/lib/rubygems/commands/cert_command.rb +++ b/lib/rubygems/commands/cert_command.rb @@ -9,7 +9,6 @@ rescue LoadError => e https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/cert_command.rb#L9 end class Gem::Commands::CertCommand < Gem::Command - def initialize super 'cert', 'Manage RubyGems certificates and signing settings', :add => [], :remove => [], :list => [], :build => [], :sign => [] @@ -318,5 +317,4 @@ For further reading on signing gems see `ri Gem::Security`. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/cert_command.rb#L317 # It's simple, but is all we need email =~ /\A.+@.+\z/ end - end if defined?(OpenSSL::SSL) diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb index 7905b8a..8b8eda5 100644 --- a/lib/rubygems/commands/check_command.rb +++ b/lib/rubygems/commands/check_command.rb @@ -5,7 +5,6 @@ require 'rubygems/validator' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/check_command.rb#L5 require 'rubygems/doctor' class Gem::Commands::CheckCommand < Gem::Command - include Gem::VersionOption def initialize @@ -90,5 +89,4 @@ specifications and will clean up gems that have been partially uninstalled. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/check_command.rb#L89 def usage # :nodoc: "#{program_name} [OPTIONS] [GEMNAME ...]" end - end diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index 98cd203..b9819a4 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -4,7 +4,6 @@ require 'rubygems/dependency_list' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/cleanup_command.rb#L4 require 'rubygems/uninstaller' class Gem::Commands::CleanupCommand < Gem::Command - def initialize super 'cleanup', 'Clean up old versions of installed gems', @@ -181,5 +180,4 @@ 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#L180 # Restore path Gem::Uninstaller may have changed Gem.use_paths @original_home, *@original_path end - end diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index d30b62d..f17aed6 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -3,7 +3,6 @@ require 'rubygems/command' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/contents_command.rb#L3 require 'rubygems/version_option' class Gem::Commands::ContentsCommand < Gem::Command - include Gem::VersionOption def initialize @@ -186,5 +185,4 @@ prefix or only the files that are requireable. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/contents_command.rb#L185 [i, File.join(i, "specifications")] end.flatten end - end diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index bdb71ad..e472d8f 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -4,7 +4,6 @@ require 'rubygems/local_remote_options' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/dependency_command.rb#L4 require 'rubygems/version_option' class Gem::Commands::DependencyCommand < Gem::Command - include Gem::LocalRemoteOptions include Gem::VersionOption @@ -215,5 +214,4 @@ use with other commands. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/dependency_command.rb#L214 /\A#{Regexp.union(*args)}/ end end - end diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb index c98a77a..3aff503 100644 --- a/lib/rubygems/commands/environment_command.rb +++ b/lib/rubygems/commands/environment_command.rb @@ -2,7 +2,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/environment_command.rb#L2 require 'rubygems/command' class Gem::Commands::EnvironmentCommand < Gem::Command - def initialize super 'environment', 'Display information about the RubyGems environment' end @@ -172,5 +171,4 @@ lib/rubygems/defaults/operating_system.rb https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/environment_command.rb#L171 return nil end - end diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb index ab77a3b..6a1b346 100644 --- a/lib/rubygems/commands/fetch_command.rb +++ b/lib/rubygems/commands/fetch_command.rb @@ -4,7 +4,6 @@ require 'rubygems/local_remote_options' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/fetch_command.rb#L4 require 'rubygems/version_option' class Gem::Commands::FetchCommand < Gem::Command - include Gem::LocalRemoteOptions include Gem::VersionOption @@ -73,5 +72,4 @@ then repackaging it. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/fetch_command.rb#L72 say "Downloaded #{spec.full_name}" end end - end diff --git a/lib/rubygems/commands/generate_index_command.rb b/lib/rubygems/commands/generate_index_command.rb index 6dccdcb..93e25ef 100644 --- a/lib/rubygems/commands/generate_index_command.rb +++ b/lib/rubygems/commands/generate_index_ (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/