1 2 3 4 5 6 7
# get the basename of the given filename module Puppet::Parser::Functions newfunction(:basename, :type => :rvalue) do |args| File.basename(args[0]) end end