Exception: Gem::Resolver::Molinillo::NoSuchDependencyError
- Inherits:
-
ResolverError
- Object
- StandardError
- ResolverError
- Gem::Resolver::Molinillo::NoSuchDependencyError
- Defined in:
- lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
Overview
An error caused by searching for a dependency that is completely unknown, i.e. has no versions available whatsoever.
Instance Attribute Summary collapse
-
#dependency ⇒ Object
The dependency that could not be found.
-
#required_by ⇒ Array<Object>
The specifications that depended upon #dependency.
Instance Method Summary collapse
-
#initialize(dependency, required_by = []) ⇒ NoSuchDependencyError
constructor
Initializes a new error with the given missing dependency.
-
#message ⇒ Object
The error message for the missing dependency, including the specifications that had this dependency.
Constructor Details
#initialize(dependency, required_by = []) ⇒ NoSuchDependencyError
Initializes a new error with the given missing dependency.
19 20 21 22 23 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 19 def initialize(dependency, required_by = []) @dependency = dependency @required_by = required_by.uniq super() end |
Instance Attribute Details
#dependency ⇒ Object
Returns the dependency that could not be found.
11 12 13 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 11 def dependency @dependency end |
#required_by ⇒ Array<Object>
Returns the specifications that depended upon #dependency.
14 15 16 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 14 def required_by @required_by end |
Instance Method Details
#message ⇒ Object
The error message for the missing dependency, including the specifications that had this dependency.
27 28 29 30 31 32 |
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 27 def sources = required_by.map { |r| "`#{r}`" }.join(' and ') = "Unable to find a specification for `#{dependency}`" += " depended upon by #{sources}" unless sources.empty? end |