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


256
257
258
259
# File 'lib/berkshelf/errors.rb', line 256

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

Instance Method Details

#to_sObject


261
262
263
264
265
266
267
268
269
# File 'lib/berkshelf/errors.rb', line 261

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