diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-03-16 13:08:50 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-03-17 18:50:55 +0900 |
commit | 0b632b9cddef76514635ad460d40b3a8d346602f () | |
tree | 33a2b39d30bb0c3de6600de132c7f6a4cda4e775 /lib | |
parent | 567db6064baf572e3510c0322ec536ad84c81d57 (diff) |
[rubygems/rubygems] util/rubocop -A --only Style/ClassCheck
https://.com/rubygems/rubygems/commit/1c3356a872
-rw-r--r-- | lib/rubygems/available_set.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/config_file.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/core_ext/kernel_gem.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/deprecate.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/gemcutter_utilities.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/name_tuple.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/request_set/gem_dependency_api.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/resolver/installed_specification.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/resolver/local_specification.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/source_list.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification_policy.rb | 6 |
12 files changed, 17 insertions, 17 deletions
@@ -26,7 +26,7 @@ class Gem::AvailableSet s = o.set when Array s = o.map do |sp,so| - if !sp.kind_of?(Gem::Specification) || !so.kind_of?(Gem::Source) raise TypeError, "Array must be in [[spec, source], ...] form" end @@ -93,7 +93,7 @@ class Gem::Command # array or a string to be split on white space. def self.add_specific_extra_args(cmd,args) - args = args.split(/\s+/) if args.kind_of? String specific_extra_args_hash[cmd] = args end @@ -352,7 +352,7 @@ if you believe they were disclosed to a third party. begin content = Gem::SafeYAML.load(File.read(filename)) - unless content.kind_of? Hash warn "Failed to load #{filename} because it doesn't contain valid YAML hash" return {} end @@ -36,7 +36,7 @@ module Kernel skip_list = (ENV["GEM_SKIP"] || "").split(/:/) raise Gem::LoadError, "skipping #{gem_name}" if skip_list.include? gem_name - if gem_name.kind_of? Gem::Dependency unless Gem::Deprecate.skip warn "#{Gem.location_of_caller.join ":"}:Warning: Kernel.gem no longer "\ "accepts a Gem::Dependency object, please pass the name "\ @@ -103,7 +103,7 @@ module Gem::Deprecate old = "_deprecated_#{name}" alias_method old, name define_method name do |*args, &block| - klass = self.kind_of? Module target = klass ? "#{self}." : "#{self.class}#" msg = [ "NOTE: #{target}#{name} is deprecated", repl == :none ? " with no replacement" : "; use #{repl} instead", @@ -128,7 +128,7 @@ module Gem::Deprecate old = "_deprecated_#{name}" alias_method old, name define_method name do |*args, &block| - klass = self.kind_of? Module target = klass ? "#{self}." : "#{self.class}#" msg = [ "NOTE: #{target}#{name} is deprecated", replacement == :none ? " with no replacement" : "; use #{replacement} instead", @@ -116,7 +116,7 @@ module Gem::GemcutterUtilities end def mfa_unauthorized?(response) - response.kind_of?(Net::HTTPUnauthorized) && response.body.start_with?("You have enabled multifactor authentication") end def update_scope(scope) @@ -319,6 +319,6 @@ module Gem::GemcutterUtilities end def api_key_forbidden?(response) - response.kind_of?(Net::HTTPForbidden) && response.body.start_with?("The API key doesn't have access") end end @@ -9,7 +9,7 @@ class Gem::NameTuple @name = name @version = version - unless platform.kind_of? Gem::Platform platform = "ruby" if !platform || platform.empty? end @@ -356,7 +356,7 @@ class Gem::RequestSet::GemDependencyAPI # Use the given tag for git:, gist: and : dependencies. def gem(name, *requirements) - options = requirements.pop if requirements.last.kind_of?(Hash) options ||= {} options[:git] = @current_repository if @current_repository @@ -24,7 +24,7 @@ class Gem::Resolver::InstalledSpecification < Gem::Resolver::SpecSpecification def installable_platform? # BACKCOMPAT If the file is coming out of a specified file, then we # ignore the platform. This code can be removed in RG 3.0. - return true if @source.kind_of? Gem::Source::SpecificFile super end @@ -7,7 +7,7 @@ class Gem::Resolver::LocalSpecification < Gem::Resolver::SpecSpecification # Returns +true+ if this gem is installable for the current platform. def installable_platform? - return true if @source.kind_of? Gem::Source::SpecificFile super end @@ -126,7 +126,7 @@ class Gem::SourceList # Gem::Source or a source URI. def include?(other) - if other.kind_of? Gem::Source @sources.include? other else @sources.find {|x| x.uri.to_s == other.to_s } @@ -137,7 +137,7 @@ class Gem::SourceList # Deletes +source+ from the source list which may be a Gem::Source or a URI. def delete(source) - if source.kind_of? Gem::Source @sources.delete source else @sources.delete_if {|x| x.uri.to_s == source.to_s } @@ -125,7 +125,7 @@ class Gem::SpecificationPolicy metadata.each do |key, value| entry = "metadata['#{key}']" - if !key.kind_of?(String) error "metadata keys must be a String" end @@ -133,7 +133,7 @@ class Gem::SpecificationPolicy error "metadata key is too large (#{key.size} > 128)" end - if !value.kind_of?(String) error "#{entry} value must be a String" end @@ -343,7 +343,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: String end - unless Array === val && val.all? {|x| x.kind_of?(klass) } error "#{field} must be an Array of #{klass}" end end |