Class Netrc
In: lib/netrc.rb
Parent: Object

Methods

[]   []=   check_permissions   default_path   delete   each   length   lex   new   new_item   parse   read   save   skip?   unparse  

Classes and Modules

Class Netrc::Error

Constants

VERSION = "0.7.7"
WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/   see stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows
CYGWIN = RbConfig::CONFIG["host_os"] =~ /cygwin/

Attributes

new_item_prefix  [RW] 

Public Class methods

Returns two values, a header and a list of items. Each item is a tuple, containing some or all of:

  • machine keyword (including trailing whitespace+comments)
  • machine name
  • login keyword (including surrounding whitespace+comments)
  • login
  • password keyword (including surrounding whitespace+comments)
  • password
  • trailing chars

This lets us change individual fields, then write out the file with all its original formatting.

Reads path and parses it as a .netrc file. If path doesn‘t exist, returns an empty object. Decrypt paths ending in .gpg.

Public Instance methods

[Validate]