summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBryan Jen <bryan.jen@gmail.com>2016-05-03 15:09:33 -0700
committerBryan Jen <bryan.jen@gmail.com>2016-05-03 15:09:33 -0700
commitf48747b8af8fdad455cfd5b5d0d2c2abfd8c9415 (patch)
tree4edf52d916fc14ea8a3bb023b505c6cfa2e27441 /lib
parent9e1f74f3fcac4aeaccade3ea92e6cafbaf71a64f (diff)
parent2a75ed08a1b967d5d64144c449a1c1aed50e8d78 (diff)
Merge pull request #603 from puppetlabs/4.12.x
Mergeback 4.12.x
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/delete.rb4
-rw-r--r--lib/puppet/parser/functions/is_email_address.rb2
2 files changed, 4 insertions, 2 deletions
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
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|