diff options
Diffstat (limited to 'lib/puppet/parser/functions/slash_escape.rb')
-rw-r--r-- | lib/puppet/parser/functions/slash_escape.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/slash_escape.rb b/lib/puppet/parser/functions/slash_escape.rb new file mode 100644 index 0000000..04d3b95 --- /dev/null +++ b/lib/puppet/parser/functions/slash_escape.rb @@ -0,0 +1,7 @@ +# escape slashes in a String +module Puppet::Parser::Functions + newfunction(:slash_escape, :type => :rvalue) do |args| + args[0].gsub(/\//, '\\/') + end +end + |