Enable Style/EmptyLinesAroundClassBody rubocop cop.
This commit is contained in:
Hiroshi SHIBATA 2020-09-23 21:02:56 +09:00
parent f56fc720ee
commit 31a6eaabc1
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
274 changed files with 672 additions and 0 deletions

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/package'
class Gem::Commands::BuildCommand < Gem::Command
def initialize
super 'build', 'Build a gem from a gemspec'
@ -107,4 +108,5 @@ Gems can be saved to a specified filename with the output option:
terminate_interaction 1
end
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/security'
class Gem::Commands::CertCommand < Gem::Command
def initialize
super 'cert', 'Manage RubyGems certificates and signing settings',
:add => [], :remove => [], :list => [], :build => [], :sign => []
@ -311,4 +312,5 @@ For further reading on signing gems see `ri Gem::Security`.
# It's simple, but is all we need
email =~ /\A.+@.+\z/
end
end if defined?(OpenSSL::SSL)

View file

@ -5,6 +5,7 @@ require 'rubygems/validator'
require 'rubygems/doctor'
class Gem::Commands::CheckCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -89,4 +90,5 @@ specifications and will clean up gems that have been partially uninstalled.
def usage # :nodoc:
"#{program_name} [OPTIONS] [GEMNAME ...]"
end
end

View file

@ -4,6 +4,7 @@ require 'rubygems/dependency_list'
require 'rubygems/uninstaller'
class Gem::Commands::CleanupCommand < Gem::Command
def initialize
super 'cleanup',
'Clean up old versions of installed gems',
@ -180,4 +181,5 @@ If no gems are named all gems in GEM_HOME are cleaned.
# Restore path Gem::Uninstaller may have changed
Gem.use_paths @original_home, *@original_path
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/version_option'
class Gem::Commands::ContentsCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -185,4 +186,5 @@ prefix or only the files that are requireable.
[i, File.join(i, "specifications")]
end.flatten
end
end

View file

@ -4,6 +4,7 @@ require 'rubygems/local_remote_options'
require 'rubygems/version_option'
class Gem::Commands::DependencyCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
@ -214,4 +215,5 @@ use with other commands.
/\A#{Regexp.union(*args)}/
end
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::EnvironmentCommand < Gem::Command
def initialize
super 'environment', 'Display information about the RubyGems environment'
end
@ -171,4 +172,5 @@ lib/rubygems/defaults/operating_system.rb
return nil
end
end

View file

@ -4,6 +4,7 @@ require 'rubygems/local_remote_options'
require 'rubygems/version_option'
class Gem::Commands::FetchCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
@ -72,4 +73,5 @@ then repackaging it.
say "Downloaded #{spec.full_name}"
end
end
end

View file

@ -8,6 +8,7 @@ require 'rubygems/indexer'
# See `gem help generate_index`
class Gem::Commands::GenerateIndexCommand < Gem::Command
def initialize
super 'generate_index',
'Generates the index files for a gem server directory',
@ -82,4 +83,5 @@ Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
end
end
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::HelpCommand < Gem::Command
# :stopdoc:
EXAMPLES = <<-EOF.freeze
Some examples of 'gem' usage.
@ -369,4 +370,5 @@ platform.
alert_warning "Unknown command #{command_name}. Try: gem help commands"
end
end
end

View file

@ -4,6 +4,7 @@ require 'rubygems/command'
require 'rubygems/query_utils'
class Gem::Commands::InfoCommand < Gem::Command
include Gem::QueryUtils
def initialize
@ -35,4 +36,5 @@ class Gem::Commands::InfoCommand < Gem::Command
def defaults_str
"--local"
end
end

View file

@ -12,6 +12,7 @@ require 'rubygems/version_option'
# See `gem help install`
class Gem::Commands::InstallCommand < Gem::Command
attr_reader :installed_specs # :nodoc:
include Gem::VersionOption
@ -269,4 +270,5 @@ You can use `i` command instead of `install`.
gems = @installed_specs.length == 1 ? 'gem' : 'gems'
say "#{@installed_specs.length} #{gems} installed"
end
end

View file

@ -6,6 +6,7 @@ require 'rubygems/query_utils'
# Searches for gems starting with the supplied argument.
class Gem::Commands::ListCommand < Gem::Command
include Gem::QueryUtils
def initialize
@ -38,4 +39,5 @@ To search for remote gems use the search command.
def usage # :nodoc:
"#{program_name} [REGEXP ...]"
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::LockCommand < Gem::Command
def initialize
super 'lock', 'Generate a lockdown list of gems',
:strict => false
@ -105,4 +106,5 @@ lock it down to the exact version.
gemspecs.find {|path| File.exist? path }
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
unless defined? Gem::Commands::MirrorCommand
class Gem::Commands::MirrorCommand < Gem::Command
def initialize
super('mirror', 'Mirror all gem files (requires rubygems-mirror)')
begin
@ -21,5 +22,6 @@ The mirror command has been moved to the rubygems-mirror gem.
def execute
alert_error "Install the rubygems-mirror gem for the mirror command"
end
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/version_option'
class Gem::Commands::OpenCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -81,4 +82,5 @@ class Gem::Commands::OpenCommand < Gem::Command
say "Unable to find gem '#{name}'"
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/spec_fetcher'
require 'rubygems/version_option'
class Gem::Commands::OutdatedCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
@ -29,4 +30,5 @@ update the gems with the update or install commands.
say "#{spec.name} (#{spec.version} < #{remote_version})"
end
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/gemcutter_utilities'
require 'rubygems/text'
class Gem::Commands::OwnerCommand < Gem::Command
include Gem::Text
include Gem::LocalRemoteOptions
include Gem::GemcutterUtilities
@ -108,4 +109,5 @@ permission to.
request.add_field "OTP", options[:otp] if options[:otp]
end
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/installer'
require 'rubygems/version_option'
class Gem::Commands::PristineCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -187,4 +188,5 @@ extensions will be restored.
say "Restored #{spec.full_name}"
end
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/gemcutter_utilities'
require 'rubygems/package'
class Gem::Commands::PushCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::GemcutterUtilities
@ -103,4 +104,5 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
gem_metadata["allowed_push_host"]
]
end
end

View file

@ -4,6 +4,7 @@ require 'rubygems/query_utils'
require 'rubygems/deprecate'
class Gem::Commands::QueryCommand < Gem::Command
extend Gem::Deprecate
rubygems_deprecate_command
@ -23,4 +24,5 @@ class Gem::Commands::QueryCommand < Gem::Command
add_query_options
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/rdoc'
require 'fileutils'
class Gem::Commands::RdocCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -92,4 +93,5 @@ Use --overwrite to force rebuilding of documentation.
end
end
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/query_utils'
class Gem::Commands::SearchCommand < Gem::Command
include Gem::QueryUtils
def initialize
@ -37,4 +38,5 @@ To list local gems use the list command.
def usage # :nodoc:
"#{program_name} [REGEXP]"
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/server'
class Gem::Commands::ServerCommand < Gem::Command
def initialize
super 'server', 'Documentation and gem repository HTTP server',
:port => 8808, :gemdir => [], :daemon => false
@ -81,4 +82,5 @@ You can set up a shortcut to gem server documentation using the URL:
options[:gemdir] = Gem.path if options[:gemdir].empty?
Gem::Server.run options
end
end

View file

@ -6,6 +6,7 @@ require 'rubygems/command'
# RubyGems checkout or tarball.
class Gem::Commands::SetupCommand < Gem::Command
HISTORY_HEADER = /^===\s*[\d.a-zA-Z]+\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
VERSION_MATCHER = /^===\s*([\d.a-zA-Z]+)\s*\/\s*\d{4}-\d{2}-\d{2}\s*$/.freeze
@ -735,4 +736,5 @@ abort "#{deprecation_message}"
def bin_file_names
@bin_file_names ||= []
end
end

View file

@ -3,6 +3,7 @@ require 'rubygems/command'
require 'rubygems/gemcutter_utilities'
class Gem::Commands::SigninCommand < Gem::Command
include Gem::GemcutterUtilities
def initialize
@ -30,4 +31,5 @@ class Gem::Commands::SigninCommand < Gem::Command
def execute
sign_in options[:host]
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::SignoutCommand < Gem::Command
def initialize
super 'signout', 'Sign out from all the current sessions.'
end
@ -28,4 +29,5 @@ class Gem::Commands::SignoutCommand < Gem::Command
say 'You have successfully signed out from all sessions.'
end
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/spec_fetcher'
require 'rubygems/local_remote_options'
class Gem::Commands::SourcesCommand < Gem::Command
include Gem::LocalRemoteOptions
def initialize
@ -219,4 +220,5 @@ To remove a source use the --remove argument:
say "*** Unable to remove #{desc} source cache ***"
end
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/version_option'
require 'rubygems/package'
class Gem::Commands::SpecificationCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
@ -142,4 +143,5 @@ Specific fields in the specification can be extracted in YAML format:
say "\n"
end
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::StaleCommand < Gem::Command
def initialize
super('stale', 'List gems along with access times')
end
@ -36,4 +37,5 @@ longer using.
say "#{name} at #{atime.strftime '%c'}"
end
end
end

View file

@ -10,6 +10,7 @@ require 'fileutils'
# See `gem help uninstall`
class Gem::Commands::UninstallCommand < Gem::Command
include Gem::VersionOption
def initialize
@ -194,4 +195,5 @@ that is a dependency of an existing gem. You can use the
def uninstall(gem_name)
Gem::Uninstaller.new(gem_name, options).uninstall
end
end

View file

@ -13,6 +13,7 @@ module Gem::Security # :nodoc:
end
class Gem::Commands::UnpackCommand < Gem::Command
include Gem::VersionOption
include Gem::SecurityOption
@ -172,4 +173,5 @@ command help for an example.
path
end
end

View file

@ -10,6 +10,7 @@ require 'rubygems/install_message' # must come before rdoc for messaging
require 'rubygems/rdoc'
class Gem::Commands::UpdateCommand < Gem::Command
include Gem::InstallUpdateOptions
include Gem::LocalRemoteOptions
include Gem::VersionOption
@ -309,4 +310,5 @@ command to remove old versions.
result
end
end

View file

@ -2,6 +2,7 @@
require 'rubygems/command'
class Gem::Commands::WhichCommand < Gem::Command
def initialize
super 'which', 'Find the location of a library file you can require',
:search_gems_first => false, :show_all => false
@ -84,4 +85,5 @@ requiring to see why it does not behave as you expect.
def usage # :nodoc:
"#{program_name} FILE [FILE ...]"
end
end

View file

@ -5,6 +5,7 @@ require 'rubygems/version_option'
require 'rubygems/gemcutter_utilities'
class Gem::Commands::YankCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
include Gem::GemcutterUtilities
@ -96,4 +97,5 @@ data you will need to change them immediately and yank your gem.
def get_platform_from_requirements(requirements)
Gem.platforms[1].to_s if requirements.key? :added_platform
end
end