def add_or_update(username, password, algorithm = Algorithm::DEFAULT)
      if has_entry?(username) then
        update(username, password, algorithm)
      else
        add(username, password, algorithm)
      end
    end
def add_or_update(username, password, algorithm = Algorithm::DEFAULT)
      if has_entry?(username) then
        update(username, password, algorithm)
      else
        add(username, password, algorithm)
      end
    end
Public: Add or update the username entry with the new password and
 algorithm. This will add a new entry if the username does not exist in
 the file. If the entry does exist in the file, then the password
 of the entry is updated to the new password / algorithm

 The file is not written to disk until #save! is called.

 username  - the username of the entry
 password  - the username of the entry
 algorithm - the algorithm to use (default: "md5"). Valid options are:
             "md5", "sha1", "plaintext", or "crypt"

 Examples

   passwd_file.add_or_update("newuser", "password", Algorithm::SHA1)
   passwd_file.save!

   passwd_file.add_or_update("newuser", "password")
   passwd_file.save!

 Returns nothing.