Exception: Berkshelf::MismatchedCookbookName

Inherits:
BerkshelfError
  • Object
show all
Defined in:
lib/berkshelf/errors.rb

Instance Method Summary collapse

Methods inherited from BerkshelfError

status_code

Constructor Details

#initialize(location, cached_cookbook) ⇒ MismatchedCookbookName

Returns a new instance of MismatchedCookbookName.

Parameters:



171
172
173
174
# File 'lib/berkshelf/errors.rb', line 171

def initialize(location, cached_cookbook)
  @location = location
  @cached_cookbook = cached_cookbook
end

Instance Method Details

#to_sObject



176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/berkshelf/errors.rb', line 176

def to_s
  [
    "In your Berksfile, you have:",
    "",
    "  cookbook '#{@location.name}'",
    "",
    "But that cookbook is actually named '#{@cached_cookbook.cookbook_name}'",
    "",
    "This can cause potentially unwanted side-effects in the future",
    "",
    "NOTE: If you don't explicitly set the `name` attribute in the metadata, the name of the directory will be used!",
  ].join("\n")
end