From 1a420297efc12ee84de9c3c71be948458d80f17b Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 26 Oct 2018 16:12:40 -0700 Subject: bit of cleanup Signed-off-by: Lamont Granquist --- lib/chef/cookbook_loader.rb | 6 ++++-- spec/unit/cookbook_loader_spec.rb | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb index 82bab34299..322de539f1 100644 --- a/lib/chef/cookbook_loader.rb +++ b/lib/chef/cookbook_loader.rb @@ -75,9 +75,9 @@ class Chef if @loaded_cookbooks.key?(cookbook_name) raise Chef::Exceptions::CookbookMergingError, "Cookbook merging is no longer supported, the cookbook named #{cookbook_name} can only appear once in the cookbook_path" - else - @loaded_cookbooks[cookbook_name] = loader end + + @loaded_cookbooks[cookbook_name] = loader end if @loaded_cookbooks.key?(cookbook_name) @@ -101,6 +101,7 @@ class Chef def has_key?(cookbook_name) not self[cookbook_name.to_sym].nil? end + alias :cookbook_exists? :has_key? alias :key? :has_key? @@ -125,6 +126,7 @@ class Chef def values @cookbooks_by_name.values end + alias :cookbooks :values private diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb index 45f03e17b6..15c7d1e299 100644 --- a/spec/unit/cookbook_loader_spec.rb +++ b/spec/unit/cookbook_loader_spec.rb @@ -152,7 +152,6 @@ describe Chef::CookbookLoader do let(:repo_paths) do [ -# File.join(CHEF_SPEC_DATA, "kitchen"), File.join(CHEF_SPEC_DATA, "cookbooks"), File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"), ] -- cgit v1.2.1