Puppet Function: windows_native_path

Defined in:
lib/puppet/parser/functions/windows_native_path.rb
Function type:
Ruby 3.x API

Overview

windows_native_path()Any

Returns:

  • (Any)

    Return a windows native path



3
4
5
6
7
8
9
10
# File 'lib/puppet/parser/functions/windows_native_path.rb', line 3

newfunction(:windows_native_path, arity: 1, type: :rvalue, doc: <<-EOS
@return Return a windows native path
EOS
) do |args|
  path = args[0]

  return path.gsub(%r{\/\s}, ' ').tr('/', '\\')
end