Method: Puppet::FileSystem.expand_path

Defined in:
lib/puppet/file_system.rb

.expand_path(path, dir_string = nil) ⇒ String

Produces a string representation of the opaque path handle, with expansions performed on ~. For Windows, this means that C:UsersAdmini~1AppData will be expanded to C:UsersAdministratorAppData. On POSIX filesystems, the value ~ will be expanded to something like /Users/Foo

This method exists primarlily to resolve a Ruby deficiency where File.expand_path doesn’t handle ~ in each segment on a Windows path

Parameters:

  • path (Object)

    a path handle produced by #pathname

Returns:

  • (String)

    a string representation of the path



356
357
358
# File 'lib/puppet/file_system.rb', line 356

def self.expand_path(path, dir_string = nil)
  @impl.expand_path(path, dir_string)
end