Method: Puppet::FileSystem::FileImpl#assert_path

Defined in:
lib/puppet/file_system/file_impl.rb

#assert_path(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet/file_system/file_impl.rb', line 10

def assert_path(path)
  return path if path.is_a?(Pathname)

  # Some paths are string, or in the case of WatchedFile, it pretends to be
  # one by implementing to_str.
  if path.respond_to?(:to_str)
    Pathname.new(path)
  else
    raise ArgumentError, _("FileSystem implementation expected Pathname, got: '%{klass}'") % { klass: path.class }
  end
end