lib/berkshelf/errors.rb in berkshelf-3.0.0.beta2 vs lib/berkshelf/errors.rb in berkshelf-3.0.0.beta3
- old
+ new
@@ -321,11 +321,11 @@
"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_dependency.name} (#{@locked_dependency.locked_version})\n\n" +
- "Try running `berks update #{@dependency.name}, which will try to find '#{@dependency.name}' matching " +
+ "Try running `berks update #{@dependency.name}`, which will try to find '#{@dependency.name}' matching " +
"'#{@dependency.version_constraint}'."
end
end
class EnvironmentNotFound < BerkshelfError
@@ -473,6 +473,20 @@
end
class DuplicateDemand < BerkshelfError; status_code(138); end
class VendorError < BerkshelfError; status_code(139); end
class LockfileNotFound < BerkshelfError; status_code(140); end
+
+ class NotACookbook < BerkshelfError
+ status_code(141)
+
+ # @param [String] path
+ # the path to the thing that is not a cookbook
+ def initialize(path)
+ @path = File.expand_path(path) rescue path
+ end
+
+ def to_s
+ "#{@path} does not appear to be a valid cookbook. Does it have a `metadata.rb`?"
+ end
+ end
end