module Puppet::Parser::Functions
newfunction(:source_exists, :type => :rvalue) do |args|
dist = args[0]
file = args[1]
path = "/var/lib/puppet/dist/" + dist + file
File.exists?(path)
end
ruby -rpuppet source_exists.rb
source_exists.rb:8: syntax error, unexpected $end, expecting kEND