Exception: Berkshelf::InvalidCookbookFiles

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

Overview

Raised when a cookbook or its recipes contain a space or invalid character in the path.

Instance Method Summary collapse

Methods inherited from BerkshelfError

set_status_code

Constructor Details

#initialize(cookbook, files) ⇒ InvalidCookbookFiles

Returns a new instance of InvalidCookbookFiles.


314
315
316
317
# File 'lib/berkshelf/errors.rb', line 314

def initialize(cookbook, files)
  @cookbook = cookbook
  @files = files
end

Instance Method Details

#to_sObject


319
320
321
322
323
324
325
326
327
# File 'lib/berkshelf/errors.rb', line 319

def to_s
  [
    "The cookbook '#{@cookbook.cookbook_name}' has invalid filenames:",
    "",
    "  " + @files.map(&:to_s).join("\n  "),
    "",
    "Please note, spaces are not a valid character in filenames",
  ].join("\n")
end