summaryrefslogtreecommitdiff
path: root/lib/rubygems/dependency_list.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/dependency_list.rb')
-rw-r--r--lib/rubygems/dependency_list.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb
index 8f61869874..ad5e59e8c1 100644
--- a/lib/rubygems/dependency_list.rb
+++ b/lib/rubygems/dependency_list.rb
@@ -1,12 +1,13 @@
# frozen_string_literal: true
+
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
-require 'tsort'
-require_relative 'deprecate'
+require_relative "vendored_tsort"
+require_relative "deprecate"
##
# Gem::DependencyList is used for installing and uninstalling gems in the
@@ -20,7 +21,7 @@ class Gem::DependencyList
attr_reader :specs
include Enumerable
- include TSort
+ include Gem::TSort
##
# Allows enabling/disabling use of development dependencies
@@ -104,7 +105,7 @@ class Gem::DependencyList
end
def inspect # :nodoc:
- "%s %p>" % [super[0..-2], map {|s| s.full_name }]
+ format("%s %p>", super[0..-2], map(&:full_name))
end
##
@@ -119,11 +120,11 @@ class Gem::DependencyList
each do |spec|
spec.runtime_dependencies.each do |dep|
inst = Gem::Specification.any? do |installed_spec|
- dep.name == installed_spec.name and
- dep.requirement.satisfied_by? installed_spec.version
+ dep.name == installed_spec.name &&
+ dep.requirement.satisfied_by?(installed_spec.version)
end
- unless inst or @specs.find {|s| s.satisfies_requirement? dep }
+ unless inst || @specs.find {|s| s.satisfies_requirement? dep }
unsatisfied[spec.name] << dep
return unsatisfied if quick
end
@@ -175,7 +176,7 @@ class Gem::DependencyList
def remove_specs_unsatisfied_by(dependencies)
specs.reject! do |spec|
dep = dependencies[spec.name]
- dep and not dep.requirement.satisfied_by? spec.version
+ dep && !dep.requirement.satisfied_by?(spec.version)
end
end