puppet-standalone-mashup/shared/lib/puppet/parser/functions/find_path.rb
2012-07-20 10:49:47 -04:00

11 lines
261 B
Ruby

module Puppet::Parser::Functions
newfunction(:find_path, :type => :rvalue) do |name, root|
Pathname(root).find do |file|
return file.to_s if file.basename == name
end
raise StandardError.new("File not found in #{root}: #{name}")
end
end