Exception: Berkshelf::OutdatedCookbookSource

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

Instance Method Summary collapse

Methods inherited from BerkshelfError

status_code

Constructor Details

#initialize(locked_source, source) ⇒ OutdatedCookbookSource

Returns a new instance of OutdatedCookbookSource.

Parameters:



266
267
268
269
# File 'lib/berkshelf/errors.rb', line 266

def initialize(locked_source, source)
  @locked_source = locked_source
  @source = source
end

Instance Method Details

#to_sObject



271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/berkshelf/errors.rb', line 271

def to_s
  [
    "Berkshelf could not find compatible versions for cookbook '#{@source.name}':",
    "  In Berksfile:",
    "    #{@source.name} (#{@source.version_constraint})",
    "",
    "  In Berksfile.lock:",
    "    #{@locked_source.name} (#{@locked_source.locked_version})",
    "",
    "Try running `berks update #{@source.name}, which will try to find  '#{@source.name}' matching '#{@source.version_constraint}'.",
  ].join("\n")
end