summaryrefslogtreecommitdiff
path: root/lib/rubygems/resolver/installer_set.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/resolver/installer_set.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/resolver/installer_set.rb')
-rw-r--r--lib/rubygems/resolver/installer_set.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/rubygems/resolver/installer_set.rb b/lib/rubygems/resolver/installer_set.rb
index f24293c0a0..f3827ad4e9 100644
--- a/lib/rubygems/resolver/installer_set.rb
+++ b/lib/rubygems/resolver/installer_set.rb
@@ -29,7 +29,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
##
# Creates a new InstallerSet that will look for gems in +domain+.
- def initialize domain
+ def initialize(domain)
super()
@domain = domain
@@ -50,7 +50,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
# Looks up the latest specification for +dependency+ and adds it to the
# always_install list.
- def add_always_install dependency
+ def add_always_install(dependency)
request = Gem::Resolver::DependencyRequest.new dependency, nil
found = find_all request
@@ -65,7 +65,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
Gem::Platform.local === s.platform
end
- if found.empty? then
+ if found.empty?
exc = Gem::UnsatisfiableDependencyError.new request
exc.errors = errors
@@ -83,7 +83,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
# Adds a local gem requested using +dep_name+ with the given +spec+ that can
# be loaded and installed using the +source+.
- def add_local dep_name, spec, source
+ def add_local(dep_name, spec, source)
@local[dep_name] = [spec, source]
end
@@ -112,7 +112,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
# Returns an array of IndexSpecification objects matching DependencyRequest
# +req+.
- def find_all req
+ def find_all(req)
res = []
dep = req.dependency
@@ -128,7 +128,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
res << Gem::Resolver::InstalledSpecification.new(self, gemspec)
end unless @ignore_installed
- if consider_local? then
+ if consider_local?
matching_local = @local.values.select do |spec, _|
req.match? spec
end.map do |spec, source|
@@ -138,7 +138,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
res.concat matching_local
begin
- if local_spec = @local_source.find_gem(name, dep.requirement) then
+ if local_spec = @local_source.find_gem(name, dep.requirement)
res << Gem::Resolver::IndexSpecification.new(
self, local_spec.name, local_spec.version,
@local_source, local_spec.platform)
@@ -161,7 +161,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
@remote_set.prefetch(reqs) if consider_remote?
end
- def prerelease= allow_prerelease
+ def prerelease=(allow_prerelease)
super
@remote_set.prerelease = allow_prerelease
@@ -179,7 +179,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
# Called from IndexSpecification to get a true Specification
# object.
- def load_spec name, ver, platform, source # :nodoc:
+ def load_spec(name, ver, platform, source) # :nodoc:
key = "#{name}-#{ver}-#{platform}"
@specs.fetch key do
@@ -192,13 +192,13 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
##
# Has a local gem for +dep_name+ been added to this set?
- def local? dep_name # :nodoc:
+ def local?(dep_name) # :nodoc:
spec, _ = @local[dep_name]
spec
end
- def pretty_print q # :nodoc:
+ def pretty_print(q) # :nodoc:
q.group 2, '[InstallerSet', ']' do
q.breakable
q.text "domain: #{@domain}"
@@ -213,7 +213,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
end
end
- def remote= remote # :nodoc:
+ def remote=(remote) # :nodoc:
case @domain
when :local then
@domain = :both if remote