module-common/lib/puppet/parser/functions/slash_escape.rb

7 lines
156 B
Ruby

# escape slashes in a String
module Puppet::Parser::Functions
newfunction(:slash_escape, :type => :rvalue) do |args|
args[0].gsub(/\//, '\\/')
end
end