class Berkshelf::MismatchedCookbookName

Public Class Methods

new(dependency, cached_cookbook) click to toggle source

@param [Dependency] dependency

the dependency with the expected name

@param [CachedCookbook] cached_cookbook

the cached_cookbook with the mismatched name
# File lib/berkshelf/errors.rb, line 132
def initialize(dependency, cached_cookbook)
  @dependency      = dependency
  @cached_cookbook = cached_cookbook
end

Public Instance Methods

message()
Alias for: to_s
to_s() click to toggle source
# File lib/berkshelf/errors.rb, line 137
def to_s
  out =  "In your Berksfile, you have:\n"
  out << "\n"
  out << "  cookbook '#{@dependency.name}'\n"
  out << "\n"
  out << "But that cookbook is actually named '#{@cached_cookbook.cookbook_name}'\n"
  out << "\n"
  out << "This can cause potentially unwanted side-effects in the future.\n"
  out << "\n"
  out << "NOTE: If you do not explicitly set the 'name' attribute in the "
  out << "metadata, the name of the directory will be used instead. This "
  out << "is often a cause of confusion for dependency solving."
  out
end
Also aliased as: message