summaryrefslogtreecommitdiff
path: root/lib/chef/run_context.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-29 16:10:31 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-30 14:51:48 -0800
commitd638ce43c7cf2208ff0db16db695212b7609b481 (patch)
treeb61c0b6ec030c0655cab80d71010127383250847 /lib/chef/run_context.rb
parent20fd1383020261c3756b54c26f4c2ea9e652d43c (diff)
downloadchef-d638ce43c7cf2208ff0db16db695212b7609b481.tar.gz
[CHEF-3376] make CookbookCompiler take a RunContext
The circular reference is not ideal, but it allows for complete extraction of all cookbook compilation into CookbookCompiler.
Diffstat (limited to 'lib/chef/run_context.rb')
-rw-r--r--lib/chef/run_context.rb29
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index e41b6603fb..c9aea18a13 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -62,12 +62,8 @@ class Chef
end
def load(run_list_expansion)
- load_libraries_in_run_list_order(run_list_expansion)
-
- load_lwrps_in_run_list_order(run_list_expansion)
- load_attributes_in_run_list_order(run_list_expansion)
-
- load_resource_definitions_in_run_list_order(run_list_expansion)
+ compiler = CookbookCompiler.new(self, run_list_expansion, events)
+ compiler.compile
@events.recipe_load_start(run_list_expansion.recipes.size)
run_list_expansion.recipes.each do |recipe|
@@ -179,27 +175,6 @@ class Chef
@loaded_attributes["#{cookbook}::#{attribute_file}"] = true
end
- def load_libraries_in_run_list_order(run_list_expansion)
- @compiler = CookbookCompiler.new(node, cookbook_collection, run_list_expansion, events)
- @compiler.compile_libraries
- end
-
- def load_attributes_in_run_list_order(run_list_expansion)
- @compiler = CookbookCompiler.new(node, cookbook_collection, run_list_expansion, events)
- @compiler.compile_attributes
- end
-
- def load_lwrps_in_run_list_order(run_list_expansion)
- @compiler = CookbookCompiler.new(node, cookbook_collection, run_list_expansion, events)
- @compiler.compile_lwrps
- end
-
- def load_resource_definitions_in_run_list_order(run_list_expansion)
- @compiler = CookbookCompiler.new(node, cookbook_collection, run_list_expansion, events)
- @compiler.compile_resource_definitions
- @definitions = @compiler.definitions
- end
-
private
def loaded_recipe(cookbook, recipe)