]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Terser method of string to array conversion courtesy of ethooz.
authorAlex Cline <acline@us.ibm.com>
Mon, 6 May 2013 20:16:38 +0000 (16:16 -0400)
committerAlex Cline <acline@us.ibm.com>
Mon, 6 May 2013 20:16:38 +0000 (16:16 -0400)
lib/puppet/parser/functions/ensure_resource.rb

index 36c423addc669806b489578e886754971e5ac786..a9a17338e03c74dd160ee0ba7bb00c3fa66c9a4c 100644 (file)
@@ -31,7 +31,7 @@ ENDOFDOC
   raise(ArgumentError, 'Must specify a title') unless title
   params ||= {}
 
-  items = title.kind_of?(Array) ? title : [title]
+  items = [title].flatten
 
   items.each do |item|
     Puppet::Parser::Functions.function(:defined_with_params)