Exception: Berkshelf::LicenseNotAllowed

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

Overview

Raised when a CachedCookbook has a license file that isn’t allowed by the Berksfile.

Instance Method Summary collapse

Methods inherited from BerkshelfError

status_code

Constructor Details

#initialize(cookbook) ⇒ LicenseNotAllowed

Returns a new instance of LicenseNotAllowed.



351
352
353
# File 'lib/berkshelf/errors.rb', line 351

def initialize(cookbook)
  @cookbook = cookbook
end

Instance Method Details

#to_sObject



355
356
357
358
359
# File 'lib/berkshelf/errors.rb', line 355

def to_s
  msg =  "'#{@cookbook.cookbook_name}' has a license of '#{@cookbook..license}', but"
  msg << " '#{@cookbook..license}' is not in your list of allowed licenses"
  msg
end