Method: Chef::Cookbook::SyntaxCheck.for_cookbook
- Defined in:
- lib/chef/cookbook/syntax_check.rb
.for_cookbook(cookbook_name, cookbook_path = nil) ⇒ Object
Creates a new SyntaxCheck given the cookbook_name and a cookbook_path. If no cookbook_path is given, Chef::Config.cookbook_path is used.
89 90 91 92 93 94 95 |
# File 'lib/chef/cookbook/syntax_check.rb', line 89 def self.for_cookbook(cookbook_name, cookbook_path=nil) cookbook_path ||= Chef::Config.cookbook_path unless cookbook_path raise ArgumentError, "Cannot find cookbook #{cookbook_name} unless Chef::Config.cookbook_path is set or an explicit cookbook path is given" end new(File.join(cookbook_path, cookbook_name.to_s)) end |