Skip to content

Commit

Permalink
Renamed exception class.
Browse files Browse the repository at this point in the history
  • Loading branch information
arangamani committed Oct 27, 2013
1 parent b662a3f commit e1a543d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/chef/taste/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Cli < Thor
def check
dependencies = DependencyChecker.check
Display.print(dependencies)
rescue NotACookbookError
puts "The path is not a cookbook path".red
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/taste/dependency_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class << self
# @raise NotACookbook the current/given path is not a cookbook
#
def check(path = Dir.pwd)
raise NotACookbook, "Path is not a cookbook" unless File.exists?(File.join(path, 'metadata.rb'))
raise NotACookbookError, "Path is not a cookbook" unless File.exists?(File.join(path, 'metadata.rb'))
ridley = Ridley::Chef::Cookbook::Metadata.from_file(File.join(path, 'metadata.rb'))
dependencies =
ridley.dependencies.map do |name, version|
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/taste/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ module Chef
module Taste
# The current/given path is not a cookbook
#
class NotACookbook < StandardError; end
class NotACookbookError < StandardError; end
end
end

0 comments on commit e1a543d

Please sign in to comment.