[rubygems/rubygems] util/rubocop -A --only Style/Alias
https://github.com/rubygems/rubygems/commit/fba6e94de9
This commit is contained in:
parent
f4d1f660d0
commit
83f9aa8f02
@ -9,7 +9,7 @@ class Gem::Commands::QueryCommand < Gem::Command
|
||||
|
||||
include Gem::QueryUtils
|
||||
|
||||
alias warning_without_suggested_alternatives deprecation_warning
|
||||
alias_method :warning_without_suggested_alternatives, :deprecation_warning
|
||||
def deprecation_warning
|
||||
warning_without_suggested_alternatives
|
||||
|
||||
|
@ -13,7 +13,7 @@ module Kernel
|
||||
# Make sure we have a reference to Ruby's original Kernel#require
|
||||
unless defined?(gem_original_require)
|
||||
# :stopdoc:
|
||||
alias gem_original_require require
|
||||
alias_method :gem_original_require, :require
|
||||
private :gem_original_require
|
||||
# :startdoc:
|
||||
end
|
||||
|
@ -204,7 +204,7 @@ class Gem::Dependency
|
||||
requirement.satisfied_by? version
|
||||
end
|
||||
|
||||
alias === =~
|
||||
alias_method :===, :=~
|
||||
|
||||
##
|
||||
# :call-seq:
|
||||
|
@ -174,6 +174,6 @@ module Gem
|
||||
##
|
||||
# The "exception" alias allows you to call raise on a SourceFetchProblem.
|
||||
|
||||
alias exception error
|
||||
alias_method :exception, :error
|
||||
end
|
||||
end
|
||||
|
@ -222,7 +222,7 @@ class Gem::SystemExitException < SystemExit
|
||||
##
|
||||
# The exit code for the process
|
||||
|
||||
alias exit_code status
|
||||
alias_method :exit_code, :status
|
||||
|
||||
##
|
||||
# Creates a new SystemExitException with the given +exit_code+
|
||||
|
@ -86,7 +86,7 @@ class Gem::NameTuple
|
||||
"#<Gem::NameTuple #{@name}, #{@version}, #{@platform}>"
|
||||
end
|
||||
|
||||
alias to_s inspect # :nodoc:
|
||||
alias_method :to_s, :inspect # :nodoc:
|
||||
|
||||
def <=>(other)
|
||||
[@name, @version, Gem::Platform.sort_priority(@platform)] <=>
|
||||
|
@ -62,7 +62,7 @@ class Gem::Package::TarReader
|
||||
end
|
||||
end
|
||||
|
||||
alias each_entry each
|
||||
alias_method :each_entry, :each
|
||||
|
||||
##
|
||||
# NOTE: Do not call #rewind during #each
|
||||
|
@ -151,7 +151,7 @@ class Gem::Package::TarReader::Entry
|
||||
@header.size
|
||||
end
|
||||
|
||||
alias length size
|
||||
alias_method :length, :size
|
||||
|
||||
##
|
||||
# Reads +len+ bytes from the tar file entry, or the rest of the entry if
|
||||
|
@ -141,7 +141,7 @@ class Gem::Platform
|
||||
self.class === other && to_a == other.to_a
|
||||
end
|
||||
|
||||
alias :eql? :==
|
||||
alias_method :eql?, :==
|
||||
|
||||
def hash # :nodoc:
|
||||
to_a.hash
|
||||
|
@ -233,7 +233,7 @@ class Gem::RemoteFetcher
|
||||
end
|
||||
end
|
||||
|
||||
alias :fetch_https :fetch_http
|
||||
alias_method :fetch_https, :fetch_http
|
||||
|
||||
##
|
||||
# Downloads +uri+ and returns it as a String.
|
||||
|
@ -767,7 +767,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
|
||||
# Block form for restricting gems to a particular set of platforms. See
|
||||
# #platform.
|
||||
|
||||
alias :platforms :platform
|
||||
alias_method :platforms, :platform
|
||||
|
||||
##
|
||||
# :category: Gem Dependencies DSL
|
||||
|
@ -48,7 +48,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
|
||||
def next_token
|
||||
@tokens.shift
|
||||
end
|
||||
alias :shift :next_token
|
||||
alias_method :shift, :next_token
|
||||
|
||||
def peek
|
||||
@tokens.first || EOF
|
||||
|
@ -244,8 +244,8 @@ class Gem::Requirement
|
||||
requirements.all? {|op, rv| OPS[op].call version, rv }
|
||||
end
|
||||
|
||||
alias :=== :satisfied_by?
|
||||
alias :=~ :satisfied_by?
|
||||
alias_method :===, :satisfied_by?
|
||||
alias_method :=~, :satisfied_by?
|
||||
|
||||
##
|
||||
# True if the requirement will not always match the latest version.
|
||||
|
@ -287,5 +287,5 @@ class Gem::Security::Policy
|
||||
true
|
||||
end
|
||||
|
||||
alias to_s name # :nodoc:
|
||||
alias_method :to_s, :name # :nodoc:
|
||||
end
|
||||
|
@ -735,7 +735,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||
|
||||
attr_accessor :activated
|
||||
|
||||
alias :activated? :activated
|
||||
alias_method :activated?, :activated
|
||||
|
||||
##
|
||||
# Autorequire was used by old RubyGems to automatically require a file.
|
||||
@ -1546,7 +1546,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||
|
||||
private :add_dependency_with_type
|
||||
|
||||
alias add_dependency add_runtime_dependency
|
||||
alias_method :add_dependency, :add_runtime_dependency
|
||||
|
||||
##
|
||||
# Adds this spec's require paths to LOAD_PATH, in the proper location.
|
||||
@ -1991,7 +1991,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||
end
|
||||
rubygems_deprecate :has_rdoc=
|
||||
|
||||
alias :has_rdoc? :has_rdoc # :nodoc:
|
||||
alias_method :has_rdoc?, :has_rdoc # :nodoc:
|
||||
rubygems_deprecate :has_rdoc?
|
||||
|
||||
##
|
||||
@ -2002,7 +2002,7 @@ class Gem::Specification < Gem::BasicSpecification
|
||||
end
|
||||
|
||||
# :stopdoc:
|
||||
alias has_test_suite? has_unit_tests?
|
||||
alias_method :has_test_suite?, :has_unit_tests?
|
||||
# :startdoc:
|
||||
|
||||
def hash # :nodoc:
|
||||
|
@ -165,7 +165,7 @@ class Gem::Version
|
||||
@version.dup
|
||||
end
|
||||
|
||||
alias to_s version
|
||||
alias_method :to_s, :version
|
||||
|
||||
##
|
||||
# True if the +version+ string matches RubyGems' requirements.
|
||||
|
@ -153,7 +153,7 @@ install:
|
||||
|
||||
def test_build_extensions_install_ext_only
|
||||
class << Gem
|
||||
alias orig_install_extension_in_lib install_extension_in_lib
|
||||
alias_method :orig_install_extension_in_lib, :install_extension_in_lib
|
||||
|
||||
remove_method :install_extension_in_lib
|
||||
|
||||
@ -199,7 +199,7 @@ install:
|
||||
class << Gem
|
||||
remove_method :install_extension_in_lib
|
||||
|
||||
alias install_extension_in_lib orig_install_extension_in_lib
|
||||
alias_method :install_extension_in_lib, :orig_install_extension_in_lib
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1704,7 +1704,7 @@ dependencies: []
|
||||
RbConfig::CONFIG["ENABLE_SHARED"], "no"
|
||||
|
||||
class << Gem
|
||||
alias orig_default_ext_dir_for default_ext_dir_for
|
||||
alias_method :orig_default_ext_dir_for, :default_ext_dir_for
|
||||
|
||||
remove_method :default_ext_dir_for
|
||||
|
||||
@ -1726,7 +1726,7 @@ dependencies: []
|
||||
class << Gem
|
||||
remove_method :default_ext_dir_for
|
||||
|
||||
alias default_ext_dir_for orig_default_ext_dir_for
|
||||
alias_method :default_ext_dir_for, :orig_default_ext_dir_for
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -541,7 +541,7 @@ class TestGemRequire < Gem::TestCase
|
||||
def test_try_activate_error_unlocks_require_monitor
|
||||
silence_warnings do
|
||||
class << ::Gem
|
||||
alias old_try_activate try_activate
|
||||
alias_method :old_try_activate, :try_activate
|
||||
def try_activate(*); raise "raised from try_activate"; end
|
||||
end
|
||||
end
|
||||
@ -553,7 +553,7 @@ class TestGemRequire < Gem::TestCase
|
||||
ensure
|
||||
silence_warnings do
|
||||
class << ::Gem
|
||||
alias try_activate old_try_activate
|
||||
alias_method :try_activate, :old_try_activate
|
||||
end
|
||||
end
|
||||
Kernel::RUBYGEMS_ACTIVATION_MONITOR.exit
|
||||
|
Loading…
x
Reference in New Issue
Block a user