Commit d0f492f8 authored by Victor Penso's avatar Victor Penso
Browse files

Support multiple notifies/subscribes in a resource

parent 02f78c95
......@@ -4,5 +4,5 @@ maintainer_email 'vic.penso@gmail.com'
license 'Apache 2.0'
description 'Use generic Chef resources by attributes'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.3.0'
version '1.4.0'
source_url 'https://github.com/vpenso/chef-base'
......@@ -110,9 +110,22 @@ resource_list.each do |resource|
value = value.join("\n") << "\n"
send(key,value)
when 'notifies','subscribes','template','not_if','only_if'
when 'template','not_if','only_if'
send(key, *value)
when 'notifies','subscribes'
# nested arrays indicate multiple notifies/subscribes
if value[0].kind_of? Array
# loop over the notifies/subscribes
value.each do |sub_value|
# and send them individually
send(key, *sub_value)
end
# a single notifies/subscribes
else
send(key, *value)
end
# Ignore the following keys...
when 'banner'
next
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment