summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-04-03 16:48:56 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-04-03 16:48:56 -0700
commit55251665bd38853466e63d8d649a744662e8884d (patch)
treee68bd6524c2801766697c232db39a2b5564d919a
parent87c66a075c21f28cbbe9e1bee64f9b0f3c36fcfc (diff)
downloadchef-55251665bd38853466e63d8d649a744662e8884d.tar.gz
Fix chefspec monkeypatching madness
Apparently chefspec considers this a public API (it isn't) Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/run_context/cookbook_compiler.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/run_context/cookbook_compiler.rb b/lib/chef/run_context/cookbook_compiler.rb
index e91c440ff1..8e8c8c6e25 100644
--- a/lib/chef/run_context/cookbook_compiler.rb
+++ b/lib/chef/run_context/cookbook_compiler.rb
@@ -102,7 +102,7 @@ class Chef
cookbook_order.each do |cookbook|
eager_load_libraries = cookbook_collection[cookbook].metadata.eager_load_libraries
if eager_load_libraries == true # actully true, not truthy
- load_libraries_from_cookbook(cookbook, "**/*.rb")
+ load_libraries_from_cookbook(cookbook)
else
$LOAD_PATH.unshift File.expand_path("libraries", cookbook_collection[cookbook].root_dir)
if eager_load_libraries # we have a String or Array<String> and not false
@@ -229,7 +229,7 @@ class Chef
raise
end
- def load_libraries_from_cookbook(cookbook_name, globs)
+ def load_libraries_from_cookbook(cookbook_name, globs = "*/*.rb")
each_file_in_cookbook_by_segment(cookbook_name, :libraries, globs) do |filename|
begin
logger.trace("Loading cookbook #{cookbook_name}'s library file: #{filename}")