class ChefCLI::Policyfile::DSL
def cookbook(name, *version_and_source_opts)
def cookbook(name, *version_and_source_opts) source_options = if version_and_source_opts.last.is_a?(Hash) version_and_source_opts.pop else {} end constraint = version_and_source_opts.first || ">= 0.0.0" spec = CookbookLocationSpecification.new(name, constraint, source_options, storage_config) if ( existing_source = @cookbook_location_specs[name] ) err = "Cookbook '#{name}' assigned to conflicting sources\n\n" err << "Previous source: #{existing_source.source_options.inspect}\n" err << "Conflicts with: #{source_options.inspect}\n" @errors << err else @cookbook_location_specs[name] = spec @errors += spec.errors end end