diff options
-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
diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 756e7ed008..619ed385f7 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -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"] + if RbConfig::CONFIG["ENABLE_SHARED"] == "no" "#{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) + File.basename(RUBYGEMS_DIR) == "lib" prefix end end diff --git a/lib/rubygems/available_set.rb b/lib/rubygems/available_set.rb index a06e506737..553640c643 100644 --- a/lib/rubygems/available_set.rb +++ b/lib/rubygems/available_set.rb @@ -104,14 +104,14 @@ class Gem::AvailableSet def to_request_set(development = :none) request_set = Gem::RequestSet.new - request_set.development = :all == development + request_set.development = development == :all 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 + development == :shallow end request_set diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index fde05e9332..f8143de64a 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -45,7 +45,7 @@ class Gem::Dependency end type = Symbol === requirements.last ? requirements.pop : :runtime - requirements = requirements.first if 1 == requirements.length # unpack + requirements = requirements.first if requirements.length == 1 # unpack unless TYPES.include? type raise ArgumentError, "Valid types are #{TYPES.inspect}, " + diff --git a/lib/rubygems/doctor.rb b/lib/rubygems/doctor.rb index d21e06b92b..600b6f4f55 100644 --- a/lib/rubygems/doctor.rb +++ b/lib/rubygems/doctor.rb @@ -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) + next if sub_directory == "specifications" && basename == "default" + next if sub_directory == "plugins" && Gem.plugin_suffix_regexp =~ (basename) type = File.directory?(child) ? "directory" : "file" diff --git a/lib/rubygems/request_set/lockfile/parser.rb b/lib/rubygems/request_set/lockfile/parser.rb index 2d98c9520b..054d2a061b 100644 --- a/lib/rubygems/request_set/lockfile/parser.rb +++ b/lib/rubygems/request_set/lockfile/parser.rb @@ -67,7 +67,7 @@ class Gem::RequestSet::Lockfile::Parser end def parse_DEPENDENCIES # :nodoc: - while [email protected]? && :text == peek.type do + while [email protected]? && peek.type == :text 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 + while peek.first(2) == [:entry, "remote"] 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 + while [email protected]? && peek.type == :text 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 + while [email protected]? && peek.type == :text 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 + while [email protected]? && peek.first == :text 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 + while [email protected]? && peek.first == :text do name = get(:text).value @platforms << name diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index ccdf2e50fe..fb164aaa36 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -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 + return if @requirements == [DefaultRequirement] list = requirements.sort_by do |_, version| version diff --git a/lib/rubygems/security/signer.rb b/lib/rubygems/security/signer.rb index cca82f1cf8..93b466a76d 100644 --- a/lib/rubygems/security/signer.rb +++ b/lib/rubygems/security/signer.rb @@ -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 } + subject_alt_name = cert.extensions.find {|e| e.oid == "subjectAltName" } if subject_alt_name /\Aemail:/ =~ subject_alt_name.value # rubocop:disable Performance/StartWith diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb index 7c3a7534a8..8e4ccc37cb 100644 --- a/lib/rubygems/source.rb +++ b/lib/rubygems/source.rb @@ -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 + return Gem::Resolver::IndexSet.new self if uri.scheme == "file" fetch_uri = if uri.host == "rubygems.org" index_uri = uri.dup diff --git a/lib/rubygems/source/lock.rb b/lib/rubygems/source/lock.rb index 49f097467b..ff71b8cf1d 100644 --- a/lib/rubygems/source/lock.rb +++ b/lib/rubygems/source/lock.rb @@ -30,7 +30,7 @@ class Gem::Source::Lock < Gem::Source end def ==(other) # :nodoc: - 0 == (self <=> other) + (self <=> other) == 0 end def hash # :nodoc: diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 1d110c7e30..4e738c3d40 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -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) + if (Time.at(2**32) rescue 32) == 32 cert_file = "#{__dir__}/#{cert_name}_cert_32.pem" return cert_file if File.exist? cert_file diff --git a/test/rubygems/utilities.rb b/test/rubygems/utilities.rb index b72b89907e..036240e12c 100644 --- a/test/rubygems/utilities.rb +++ b/test/rubygems/utilities.rb @@ -39,7 +39,7 @@ class Gem::FakeFetcher end def find_data(path) - return Gem.read_binary path.path if URI === path && "file" == path.scheme + return Gem.read_binary path.path if URI === path && path.scheme == "file" if URI === path && "URI::#{path.scheme.upcase}" != path.class.name raise ArgumentError, |