From c363af0628386b9d67121db7c4f2fa2a5e8b9f65 Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 27 Jun 2006 21:14:55 +0000 Subject: Adding "fail" function, which will raise a ParseError if it is encountered. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1322 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/parser/functions.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index b60d94b0a..569d70c52 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -115,6 +115,11 @@ module Functions return retval end + + newfunction(:fail, :statement) do |vals| + vals = vals.join(" ") if vals.is_a? Array + raise Puppet::ParseError, vals + end end end -- cgit