X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fglob.rb;h=e9d35b282f9ef72b7146d3258dff6fc27ca2167d;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=54cdda61d0cd78cbd3fc2a6e5edf7742b8fa67ce;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/glob.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/glob.rb index 54cdda61d..e9d35b282 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/glob.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/glob.rb @@ -1,21 +1,24 @@ # # glob.rb # - module Puppet::Parser::Functions - newfunction(:glob, :type => :rvalue, :doc => <<-'EOS' + newfunction(:glob, :type => :rvalue, :doc => <<-'DOC' Returns an Array of file entries of a directory or an Array of directories. Uses same patterns as Dir#glob - EOS - ) do |arguments| + DOC + ) do |arguments| - raise(Puppet::ParseError, "glob(): Wrong number of arguments given " + - "(#{arguments.size} for 1)") unless arguments.size == 1 + unless arguments.size == 1 + raise(Puppet::ParseError, 'glob(): Wrong number of arguments given ' \ + "(#{arguments.size} for 1)") + end pattern = arguments[0] - raise(Puppet::ParseError, 'glob(): Requires either array or string ' + - 'to work') unless pattern.is_a?(String) || pattern.is_a?(Array) + unless pattern.is_a?(String) || pattern.is_a?(Array) + raise(Puppet::ParseError, 'glob(): Requires either array or string ' \ + 'to work') + end Dir.glob(pattern) end