Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8394097
glob.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
750 B
Subscribers
None
glob.rb
View Options
#
# glob.rb
#
module
Puppet::Parser::Functions
newfunction
(
:glob
,
:type
=>
:rvalue
,
:doc
=>
<<-
DOC
@summary
Uses same patterns as Dir#glob.
@return
Returns an Array of file entries of a directory or an Array of directories.
@example Example Usage:
$confs = glob(['/etc/**/*.conf', '/opt/**/*.conf'])
DOC
)
do
|
arguments
|
unless
arguments
.
size
==
1
raise
(
Puppet
::
ParseError
,
'glob(): Wrong number of arguments given '
\
"(
#{
arguments
.
size
}
for 1)"
)
end
pattern
=
arguments
[
0
]
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
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Wed, Jun 4, 7:21 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3371782
Attached To
rSPSTD puppet-puppetlabs-stdlib
Event Timeline
Log In to Comment