summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorHelen <helen@puppetlabs.com>2016-04-26 16:24:32 +0100
committerHelen <helen@puppetlabs.com>2016-04-26 16:24:32 +0100
commitfc1851790554efdb39200d84bab73d08a5249be4 (patch)
tree70444106b30f5aa041014b181f7f37f2df1395c4 /lib/puppet/parser/functions
parent27236a73b2d6bb362f8125587a8939db562954b8 (diff)
parent19752a7ff378a35f287bf5351d466a1eae399266 (diff)
Merge pull request #599 from hunner/fix_delete
Undo changing delete() to delete regex matches
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/delete.rb4
1 files changed, 3 insertions, 1 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