summaryrefslogtreecommitdiff
path: root/lib/chef/dsl/resources.rb
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2015-05-22 12:36:15 -0700
committerNoah Kantrowitz <noah@coderanger.net>2015-05-22 12:36:15 -0700
commit8c28b46ac438ebb416b9a6083ec8f0772b346dc9 (patch)
treedba3118d9408425d59c0d8c2c68adeb68225eedd /lib/chef/dsl/resources.rb
parentf707785c140496b9df0c7841910dabf52380a1cd (diff)
downloadchef-8c28b46ac438ebb416b9a6083ec8f0772b346dc9.tar.gz
Allow nameless resources again to match release semantics.
Diffstat (limited to 'lib/chef/dsl/resources.rb')
-rw-r--r--lib/chef/dsl/resources.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/dsl/resources.rb b/lib/chef/dsl/resources.rb
index 4072ff2c89..a181c3be33 100644
--- a/lib/chef/dsl/resources.rb
+++ b/lib/chef/dsl/resources.rb
@@ -10,12 +10,12 @@ class Chef
def self.add_resource_dsl(dsl_name)
begin
module_eval(<<-EOM, __FILE__, __LINE__+1)
- def #{dsl_name}(name, created_at=nil, &block)
+ def #{dsl_name}(name=nil, created_at=nil, &block)
declare_resource(#{dsl_name.inspect}, name, created_at || caller[0], &block)
end
EOM
rescue SyntaxError
- define_method(dsl_name.to_sym) do |name, created_at=nil, &block|
+ define_method(dsl_name.to_sym) do |name=nil, created_at=nil, &block|
declare_resource(dsl_name, name, created_at || caller[0], &block)
end
end