Used Internally. Wraps a Dependency object to also track which spec contained the Dependency.
The wrapped Gem::Dependency
The request for this dependency.
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 21
def initialize(dependency, requester)
@dependency = dependency
@requester = requester
end
Creates a new DependencyRequest
for dependency
from requester
. +requester may be nil if the request came from a user.
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 40
def development?
@dependency.type == :development
end
Is this dependency a development dependency?
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 77
def explicit?
@requester.nil?
end
Indicate that the request is for a gem explicitly requested by the user
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 85
def implicit?
!explicit?
end
Indicate that the request is for a gem requested as a dependency of another gem
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 50
def match?(spec, allow_prerelease = false)
@dependency.match? spec, nil, allow_prerelease
end
Does this dependency request match spec
?
NOTE: match?
only matches prerelease versions when dependency
is a prerelease dependency.
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 59
def matches_spec?(spec)
@dependency.matches_spec? spec
end
Does this dependency request match spec
?
NOTE: matches_spec?
matches prerelease versions. See also match?
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 66
def name
@dependency.name
end
The name of the gem this dependency request is requesting.
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 93
def request_context
@requester ? @requester.request : "(unknown)"
end
Return a String
indicating who caused this request to be added (only valid for implicit requests)
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 111
def requirement
@dependency.requirement
end
The version requirement for this dependency request
# File tmp/rubies/ruby-3.1.3/lib/rubygems/resolver/dependency_request.rb, line 70
def type
@dependency.type
end