Puppet Function: bacula::escape
- Defined in:
- lib/puppet/functions/bacula/escape.rb
- Function type:
- Ruby 4.x API
Overview
Return a quoted escaped string suitable for bacula configuration
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/functions/bacula/escape.rb', line 4 Puppet::Functions.create_function(:'bacula::escape') do # @param value The string to escape # @return [String] The escaped string # @example # bacula::escape('sed -i "" -e s|a|b| /tmp/tmp.U6BF0NIS') #=> "\"sed -i \\\"\\\" -e s|a|b| /tmp/tmp.U6BF0NIS\"" dispatch :escape do param 'String', :value return_type 'String' end def escape(value) value.inspect end end |