diff options
author | danielsdeleo <dan@opscode.com> | 2013-05-27 12:18:41 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-05-29 11:32:22 -0700 |
commit | 7761abd2ef185acca93c9330db235f6704689ae4 (patch) | |
tree | 752639885f2a7e7a095a82b2613a8adca9159132 /lib/chef/mixin/template.rb | |
parent | ca4cd1f830fae2fac3e2c18bbd2693b0caddcb33 (diff) | |
download | chef-7761abd2ef185acca93c9330db235f6704689ae4.tar.gz |
Move helper module compilation inside template resource
- Resource::Template compiles helper methods/module bodies into a
collection of modules for inclusion into the template context.
- Resource::Template checks for obvious invalid input to helper
definition methods.
Diffstat (limited to 'lib/chef/mixin/template.rb')
-rw-r--r-- | lib/chef/mixin/template.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb index 0e7bbeb73a..8a0cb060f6 100644 --- a/lib/chef/mixin/template.rb +++ b/lib/chef/mixin/template.rb @@ -94,28 +94,6 @@ class Chef # INTERNAL PUBLIC API ### - def _define_helpers(helper_methods) - # TODO (ruby 1.8 hack) - # This is most elegantly done with Object#define_singleton_method, - # however ruby 1.8.7 does not support that, so we create a module and - # include it. This should be revised when 1.8 support is not needed. - helper_mod = Module.new do - helper_methods.each do |method_name, method_body| - define_method(method_name, &method_body) - end - end - @_extension_modules << helper_mod - extend(helper_mod) - end - - def _define_helpers_from_blocks(blocks) - blocks.each do |module_body| - helper_mod = Module.new(&module_body) - extend(helper_mod) - @_extension_modules << helper_mod - end - end - def _extend_modules(module_names) module_names.each do |mod| extend(mod) |