Method: Puppet::Util::Plist.open_file_with_args

Defined in:
lib/puppet/util/plist.rb

.open_file_with_args(file, args) ⇒ 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.

Helper method to assist in reading a file. It’s its own method for stubbing purposes

Parameters:

  • args (String)

    Extra file operation mode information to use (defaults to read-only mode ‘r’) This is the standard mechanism Ruby uses in the IO class, and therefore encoding may be explicitly like fmode : encoding or fmode : “BOM|UTF-*” for example, a:ASCII or w+:UTF-8



96
97
98
# File 'lib/puppet/util/plist.rb', line 96

def open_file_with_args(file, args)
  File.open(file, args).read
end