diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-03-16 13:38:45 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-03-17 18:50:55 +0900 |
commit | d8c5fa963fbf34d10599fff571f87c36410dab13 () | |
tree | 924ae2807b0cecfa114cab4f435df1fd4e4e3533 | |
parent | 66bd2c1a1cea53dec4cf2d9e625ac01d3418863e (diff) |
[rubygems/rubygems] util/rubocop -A --only Style/YodaCondition
https://.com/rubygems/rubygems/commit/3594945391
-rw-r--r-- | lib/rubygems.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/available_set.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/dependency.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/doctor.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/request_set/lockfile/parser.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/requirement.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/security/signer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/source.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/source/lock.rb | 2 | ||||
-rw-r--r-- | test/rubygems/helper.rb | 2 | ||||
-rw-r--r-- | test/rubygems/utilities.rb | 2 |
11 files changed, 19 insertions, 19 deletions
@@ -454,7 +454,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # distinction as extensions cannot be shared between the two. def self.extension_api_version # :nodoc: - if "no" == RbConfig::CONFIG["ENABLE_SHARED"] "#{ruby_api_version}-static" else ruby_api_version @@ -731,7 +731,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} if prefix != File.expand_path(RbConfig::CONFIG["sitelibdir"]) && prefix != File.expand_path(RbConfig::CONFIG["libdir"]) && - "lib" == File.basename(RUBYGEMS_DIR) prefix end end @@ -104,14 +104,14 @@ class Gem::AvailableSet def to_request_set(development = :none) request_set = Gem::RequestSet.new - request_set.development = :all == development each_spec do |spec| request_set.always_install << spec request_set.gem spec.name, spec.version request_set.import spec.development_dependencies if - :shallow == development end request_set @@ -45,7 +45,7 @@ class Gem::Dependency end type = Symbol === requirements.last ? requirements.pop : :runtime - requirements = requirements.first if 1 == requirements.length # unpack unless TYPES.include? type raise ArgumentError, "Valid types are #{TYPES.inspect}, " + @@ -111,8 +111,8 @@ class Gem::Doctor basename = File.basename(child, extension) next if installed_specs.include? basename next if /^rubygems-\d/ =~ basename - next if "specifications" == sub_directory && "default" == basename - next if "plugins" == sub_directory && Gem.plugin_suffix_regexp =~ (basename) type = File.directory?(child) ? "directory" : "file" @@ -67,7 +67,7 @@ class Gem::RequestSet::Lockfile::Parser end def parse_DEPENDENCIES # :nodoc: - while [email protected]? && :text == peek.type do token = get :text requirements = [] @@ -110,7 +110,7 @@ class Gem::RequestSet::Lockfile::Parser def parse_GEM # :nodoc: sources = [] - while [:entry, "remote"] == peek.first(2) do get :entry, "remote" data = get(:text).value skip :newline @@ -127,7 +127,7 @@ class Gem::RequestSet::Lockfile::Parser set = Gem::Resolver::LockSet.new sources last_specs = nil - while [email protected]? && :text == peek.type do token = get :text name = token.value column = token.column @@ -199,7 +199,7 @@ class Gem::RequestSet::Lockfile::Parser last_spec = nil - while [email protected]? && :text == peek.type do token = get :text name = token.value column = token.column @@ -246,7 +246,7 @@ class Gem::RequestSet::Lockfile::Parser set = Gem::Resolver::VendorSet.new last_spec = nil - while [email protected]? && :text == peek.first do token = get :text name = token.value column = token.column @@ -281,7 +281,7 @@ class Gem::RequestSet::Lockfile::Parser end def parse_PLATFORMS # :nodoc: - while [email protected]? && :text == peek.first do name = get(:text).value @platforms << name @@ -155,7 +155,7 @@ class Gem::Requirement # Formats this requirement for use in a Gem::RequestSet::Lockfile. def for_lockfile # :nodoc: - return if [DefaultRequirement] == @requirements list = requirements.sort_by do |_, version| version @@ -105,7 +105,7 @@ class Gem::Security::Signer # this value is preferred, otherwise the subject is used. def extract_name(cert) # :nodoc: - subject_alt_name = cert.extensions.find {|e| "subjectAltName" == e.oid } if subject_alt_name /\Aemail:/ =~ subject_alt_name.value # rubocop:disable Performance/StartWith @@ -71,7 +71,7 @@ class Gem::Source # Returns a Set that can fetch specifications from this source. def dependency_resolver_set # :nodoc: - return Gem::Resolver::IndexSet.new self if "file" == uri.scheme fetch_uri = if uri.host == "rubygems.org" index_uri = uri.dup @@ -30,7 +30,7 @@ class Gem::Source::Lock < Gem::Source end def ==(other) # :nodoc: - 0 == (self <=> other) end def hash # :nodoc: @@ -1521,7 +1521,7 @@ Also, a list: # <tt>test/rubygems/</tt>. def self.cert_path(cert_name) - if 32 == (Time.at(2**32) rescue 32) cert_file = "#{__dir__}/#{cert_name}_cert_32.pem" return cert_file if File.exist? cert_file @@ -39,7 +39,7 @@ class Gem::FakeFetcher end def find_data(path) - return Gem.read_binary path.path if URI === path && "file" == path.scheme if URI === path && "URI::#{path.scheme.upcase}" != path.class.name raise ArgumentError, |