Exception: Berkshelf::OutdatedDependency

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

Instance Method Summary collapse

Methods inherited from BerkshelfError

set_status_code

Constructor Details

#initialize(locked, dependency) ⇒ OutdatedDependency

Returns a new instance of OutdatedDependency.

Parameters:

  • locked_dependency (Dependency)

    the locked dependency

  • dependency (Dependency)

    the dependency that is outdated



283
284
285
286
# File 'lib/berkshelf/errors.rb', line 283

def initialize(locked, dependency)
  @locked     = locked
  @dependency = dependency
end

Instance Method Details

#to_sObject Also known as: message



288
289
290
291
292
293
294
295
296
# File 'lib/berkshelf/errors.rb', line 288

def to_s
  "Berkshelf could not find compatible versions for cookbook '#{@dependency.name}':\n" +
    "  In Berksfile:\n" +
    "    #{@dependency.name} (#{@dependency.version_constraint})\n\n" +
    "  In Berksfile.lock:\n" +
    "    #{@locked.name} (#{@locked.version})\n\n" +
    "Try running `berks update #{@dependency.name}`, which will try to find '#{@dependency.name}' matching " +
    "'#{@dependency.version_constraint}'."
end