From a83318d3ee41683118a55a2b15769c97efbcf6d9 Mon Sep 17 00:00:00 2001 From: Richard Soderberg Date: Tue, 26 Mar 2013 15:49:09 -0700 Subject: prefix: fix doc typo Examles -> Examples --- lib/puppet/parser/functions/prefix.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser/functions/prefix.rb') diff --git a/lib/puppet/parser/functions/prefix.rb b/lib/puppet/parser/functions/prefix.rb index 4593976..243cf18 100644 --- a/lib/puppet/parser/functions/prefix.rb +++ b/lib/puppet/parser/functions/prefix.rb @@ -6,7 +6,7 @@ module Puppet::Parser::Functions newfunction(:prefix, :type => :rvalue, :doc => <<-EOS This function applies a prefix to all elements in an array. -*Examles:* +*Examples:* prefix(['a','b','c'], 'p') -- cgit v1.2.3 From 29402f31e73a426dcc449216010834884d0251ec Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Wed, 27 Mar 2013 13:37:25 -0700 Subject: (maint) better error reporting for prefix and suffix When prefix and suffix did error checking with positional arguments, they would not report the position of the argument that failed to validate. This commit changes the messages to indicate which argument failed. --- lib/puppet/parser/functions/prefix.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/puppet/parser/functions/prefix.rb') diff --git a/lib/puppet/parser/functions/prefix.rb b/lib/puppet/parser/functions/prefix.rb index 243cf18..62211ae 100644 --- a/lib/puppet/parser/functions/prefix.rb +++ b/lib/puppet/parser/functions/prefix.rb @@ -21,14 +21,14 @@ Will return: ['pa','pb','pc'] array = arguments[0] unless array.is_a?(Array) - raise(Puppet::ParseError, 'prefix(): Requires array to work with') + raise Puppet::ParseError, "prefix(): expected first argument to be an Array, got #{array.inspect}" end prefix = arguments[1] if arguments[1] if prefix unless prefix.is_a?(String) - raise(Puppet::ParseError, 'prefix(): Requires string to work with') + raise Puppet::ParseError, "prefix(): expected second argument to be a String, got #{suffix.inspect}" end end -- cgit v1.2.3