W3cubDocs

/Ruby 2.7

class Bundler::Molinillo::NoSuchDependencyError

Parent:
Bundler::Molinillo::ResolverError

An error caused by searching for a dependency that is completely unknown, i.e. has no versions available whatsoever.

Attributes

dependency[RW]

@return [Object] the dependency that could not be found

required_by[RW]

@return [Array<Object>] the specifications that depended upon {#dependency}

Public Class Methods

new(dependency, required_by = []) Show source
# File lib/bundler/vendor/molinillo/lib/molinillo/errors.rb, line 19
def initialize(dependency, required_by = [])
  @dependency = dependency
  @required_by = required_by.uniq
  super()
end

Initializes a new error with the given missing dependency. @param [Object] dependency @see {#dependency} @param [Array<Object>] required_by @see {#required_by}

Calls superclass method Exception::new

Public Instance Methods

message() Show source
# File lib/bundler/vendor/molinillo/lib/molinillo/errors.rb, line 27
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

The error message for the missing dependency, including the specifications that had this dependency.

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.