mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
Import puppet-common from https://github.com/camptocamp/puppet-common.git
(imported from commit bb3ccac0dd0cc5688be0f1487092cbe34b107002)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# dirname(string) : string
|
||||
# dirname(string[]) : string[]
|
||||
#
|
||||
# Returns all components of the filename given as argument except the last
|
||||
# one. The filename must be formed using forward slashes (``/..) regardless of
|
||||
# the separator used on the local file system.
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:dirname, :type => :rvalue) do |args|
|
||||
if args[0].is_a?(Array)
|
||||
args.collect do |a| File.dirname(a) end
|
||||
else
|
||||
File.dirname(args[0])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user