Used Internally. Wraps a Dependency object to also track which spec contained the Dependency.
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 11 def initialize(dep, act) @dependency = dep @requester = act end
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 16 def ==(other) case other when Gem::Dependency @dependency == other when Gem::DependencyResolver::DependencyRequest @dependency == other.dependency && @requester == other.requester else false end end
Indicate that the request is for a gem explicitly requested by the user
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 36 def explicit? @requester.nil? end
Indicate that the requset is for a gem requested as a dependency of another gem
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 41 def implicit? !explicit? end
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 27 def matches_spec?(spec) @dependency.matches_spec? spec end
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 31 def name @dependency.name end
Return a String indicating who caused this request to be added (only valid for implicit requests)
# File lib/rubygems/dependency_resolver/dependency_request.rb, line 47 def request_context @requester ? @requester.request : "(unknown)" end