From 79c871322f92bd03206ab392f9f2972f3ace97ea Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 18 Apr 2016 09:46:30 +0100 Subject: (MODULES-3271) Ensure that is_email_address works on unsupported rubies --- lib/puppet/parser/functions/is_email_address.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet') diff --git a/lib/puppet/parser/functions/is_email_address.rb b/lib/puppet/parser/functions/is_email_address.rb index ab8d075..4fb0229 100644 --- a/lib/puppet/parser/functions/is_email_address.rb +++ b/lib/puppet/parser/functions/is_email_address.rb @@ -3,7 +3,7 @@ # module Puppet::Parser::Functions - newfunction(:is_email_address, type: :rvalue, doc: <<-EOS + newfunction(:is_email_address, :type => :rvalue, :doc => <<-EOS Returns true if the string passed to this function is a valid email address. EOS ) do |arguments| -- cgit v1.2.3 From 232de137f1018060b256b1f3f649be0b6d7d9952 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Mon, 25 Apr 2016 14:33:43 -0700 Subject: Revert "Add support for regular expressions to delete" This reverts commit 0d46515b57cea60d4d5f1e4d81a75a448a7a73a8. It introduced backwards-incompatible functionality. --- lib/puppet/parser/functions/delete.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/puppet') diff --git a/lib/puppet/parser/functions/delete.rb b/lib/puppet/parser/functions/delete.rb index 8435163..f548b44 100644 --- a/lib/puppet/parser/functions/delete.rb +++ b/lib/puppet/parser/functions/delete.rb @@ -2,6 +2,8 @@ # delete.rb # +# TODO(Krzysztof Wilczynski): We need to add support for regular expression ... + module Puppet::Parser::Functions newfunction(:delete, :type => :rvalue, :doc => <<-EOS Deletes all instances of a given element from an array, substring from a @@ -32,7 +34,7 @@ string, or key from a hash. Array(arguments[1]).each do |item| case collection when Array, Hash - collection.delete_if { |coll_item| coll_item =~ %r{#{item}} } + collection.delete item when String collection.gsub! item, '' else -- cgit v1.2.3