class Gem::Resolver::DependencyRequest

Used Internally. Wraps a Dependency object to also track which spec contained the Dependency.

Attributes

dependency[R]

The wrapped Gem::Dependency

requester[R]

The request for this dependency.

Public Class Methods

new(dependency, requester) click to toggle source

Creates a new DependencyRequest for dependency from requester. +requester may be nil if the request came from a user.

# File lib/rubygems/resolver/dependency_request.rb, line 21
def initialize dependency, requester
  @dependency = dependency
  @requester  = requester
end

Public Instance Methods

development?() click to toggle source

Is this dependency a development dependency?

# File lib/rubygems/resolver/dependency_request.rb, line 40
def development?
  @dependency.type == :development
end
explicit?() click to toggle source

Indicate that the request is for a gem explicitly requested by the user

# File lib/rubygems/resolver/dependency_request.rb, line 73
def explicit?
  @requester.nil?
end
implicit?() click to toggle source

Indicate that the request is for a gem requested as a dependency of another gem

# File lib/rubygems/resolver/dependency_request.rb, line 81
def implicit?
  !explicit?
end
match?(spec) click to toggle source

Does this dependency request match spec?

NOTE: match? only matches prerelease versions when dependency is a prerelease dependency.

# File lib/rubygems/resolver/dependency_request.rb, line 50
def match? spec
  @dependency.match? spec
end
matches_spec?(spec) click to toggle source

Does this dependency request match spec?

NOTE: matches_spec? matches prerelease versions. See also match?

# File lib/rubygems/resolver/dependency_request.rb, line 59
def matches_spec?(spec)
  @dependency.matches_spec? spec
end
name() click to toggle source

The name of the gem this dependency request is requesting.

# File lib/rubygems/resolver/dependency_request.rb, line 66
def name
  @dependency.name
end
request_context() click to toggle source

Return a String indicating who caused this request to be added (only valid for implicit requests)

# File lib/rubygems/resolver/dependency_request.rb, line 89
def request_context
  @requester ? @requester.request : "(unknown)"
end
requirement() click to toggle source

The version requirement for this dependency request

# File lib/rubygems/resolver/dependency_request.rb, line 107
def requirement
  @dependency.requirement
end