aboutsummaryrefslogtreecommitdiff
path: root/plugins/puppet/parser/functions/slash_escape.rb
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/puppet/parser/functions/slash_escape.rb')
-rw-r--r--plugins/puppet/parser/functions/slash_escape.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/puppet/parser/functions/slash_escape.rb b/plugins/puppet/parser/functions/slash_escape.rb
new file mode 100644
index 0000000..04d3b95
--- /dev/null
+++ b/plugins/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
+