diff options
author | Hunter Haugen <hunter@puppet.com> | 2016-04-25 14:33:43 -0700 |
---|---|---|
committer | Hunter Haugen <hunter@puppet.com> | 2016-04-25 14:33:43 -0700 |
commit | 232de137f1018060b256b1f3f649be0b6d7d9952 (patch) | |
tree | dfc0255cb67b5f5a75300ac74fa08e741f4d0507 /lib/puppet | |
parent | 27236a73b2d6bb362f8125587a8939db562954b8 (diff) |
Revert "Add support for regular expressions to delete"
This reverts commit 0d46515b57cea60d4d5f1e4d81a75a448a7a73a8.
It introduced backwards-incompatible functionality.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/functions/delete.rb | 4 |
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 |