Exception: CookbookOmnifetch::NotACookbook

Inherits:
OmnifetchError show all
Defined in:
lib/cookbook-omnifetch/exceptions.rb

Overview

NOTE: This is the only error class copied from berks that is also used elsewhere in berks, in ‘berkshelf/init_generator’

Instance Method Summary collapse

Methods inherited from OmnifetchError

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



51
52
53
54
# File 'lib/cookbook-omnifetch/exceptions.rb', line 51

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

Instance Method Details

#to_sObject



56
57
58
59
# File 'lib/cookbook-omnifetch/exceptions.rb', line 56

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