Added basename and dirname functions.
This commit is contained in:
parent
eb0fb28ea2
commit
e8788f51bf
2 changed files with 12 additions and 0 deletions
6
util/lib/puppet/parser/functions/basename.rb
Normal file
6
util/lib/puppet/parser/functions/basename.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
module Puppet::Parser::Functions
|
||||||
|
newfunction(:basename, :type => :rvalue) do |args|
|
||||||
|
File.basename(args[0])
|
||||||
|
end
|
||||||
|
end
|
6
util/lib/puppet/parser/functions/dirname.rb
Normal file
6
util/lib/puppet/parser/functions/dirname.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
module Puppet::Parser::Functions
|
||||||
|
newfunction(:dirname, :type => :rvalue) do |args|
|
||||||
|
File.dirname(args[0])
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue