Exception: Berkshelf::NotACookbook

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

Instance Method Summary collapse

Methods inherited from BerkshelfError

set_status_code

Constructor Details

#initialize(path) ⇒ NotACookbook

Returns a new instance of NotACookbook.

Parameters:

  • path (String)

    the path to the thing that is not a cookbook


410
411
412
# File 'lib/berkshelf/errors.rb', line 410

def initialize(path)
  @path = File.expand_path(path) rescue path
end

Instance Method Details

#to_sObject


414
415
416
417
# File 'lib/berkshelf/errors.rb', line 414

def to_s
  "The resource at '#{@path}' does not appear to be a valid cookbook. " \
  "Does it have a metadata.rb?"
end