Exception: Gem::ImpossibleDependenciesError
- Defined in:
- lib/rubygems/exceptions.rb
Overview
Raised by Gem::Resolver when dependencies conflict and create the inability to find a valid possible spec for a request.
Instance Attribute Summary collapse
-
#conflicts ⇒ Object
readonly
Returns the value of attribute conflicts.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Attributes inherited from Exception
Instance Method Summary collapse
-
#build_message ⇒ Object
:nodoc:.
- #dependency ⇒ Object
-
#initialize(request, conflicts) ⇒ ImpossibleDependenciesError
constructor
A new instance of ImpossibleDependenciesError.
Methods included from Deprecate
deprecate, skip, skip=, skip_during
Constructor Details
#initialize(request, conflicts) ⇒ ImpossibleDependenciesError
Returns a new instance of ImpossibleDependenciesError.
143 144 145 146 147 148 |
# File 'lib/rubygems/exceptions.rb', line 143 def initialize(request, conflicts) @request = request @conflicts = conflicts super end |
Instance Attribute Details
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts
140 141 142 |
# File 'lib/rubygems/exceptions.rb', line 140 def conflicts @conflicts end |
#request ⇒ Object (readonly)
Returns the value of attribute request
141 142 143 |
# File 'lib/rubygems/exceptions.rb', line 141 def request @request end |
Instance Method Details
#build_message ⇒ Object
:nodoc:
150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/rubygems/exceptions.rb', line 150 def # :nodoc: requester = @request.requester requester = requester ? requester.spec.full_name : 'The user' dependency = @request.dependency = "#{requester} requires #{dependency} but it conflicted:\n".dup @conflicts.each do |_, conflict| << conflict.explanation end end |
#dependency ⇒ Object
164 165 166 |
# File 'lib/rubygems/exceptions.rb', line 164 def dependency @request.dependency end |