Exception: Gem::Resolver::Molinillo::NoSuchDependencyError

Inherits:
ResolverError
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(dependency, required_by = []) ⇒ NoSuchDependencyError

Returns a new instance of NoSuchDependencyError.

Parameters:



17
18
19
20
21
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 17

def initialize(dependency, required_by = [])
  @dependency = dependency
  @required_by = required_by
  super()
end

Instance Attribute Details

#dependencyObject

Returns the dependency that could not be found.

Returns:

  • (Object)

    the dependency that could not be found



10
11
12
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 10

def dependency
  @dependency
end

#required_byArray<Object>

Returns the specifications that depended upon #dependency.

Returns:

  • (Array<Object>)

    the specifications that depended upon #dependency



13
14
15
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 13

def required_by
  @required_by
end

Instance Method Details

#messageObject



23
24
25
26
27
28
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb', line 23

def message
  sources = required_by.map { |r| "`#{r}`" }.join(' and ')
  message = "Unable to find a specification for `#{dependency}`"
  message << " depended upon by #{sources}" unless sources.empty?
  message
end