class XcodeInstaller::Credentials

Attributes

hostname[RW]
password[RW]
username[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/xcode-installer/credentials.rb, line 7
def initialize
  super
  @hostname = XcodeInstaller::AppleDeveloperCenter::HOST
end

Public Instance Methods

ask() click to toggle source
# File lib/xcode-installer/credentials.rb, line 17
def ask
      #def username
      #  @username ||= ask "Username:"
      #end
      #def password
      #  @password ||= pw "Password:"
      #end
  @username = ask "Username:"
  @password = pw "Password:"
  ask "Save these credentials in your keychain?"
end
load() click to toggle source
# File lib/xcode-installer/credentials.rb, line 12
def load
  pw = Security::InternetPassword.find(:server => @hostname)
  @username, @password = pw.attributes['acct'], pw.password if pw
end
save() click to toggle source
# File lib/xcode-installer/credentials.rb, line 29
def save
  #say_warning "You are already authenticated" if Security::InternetPassword.find(:server => @hostname)

  Security::InternetPassword.add(@hostname, @username, @password)

  say_ok "Account credentials saved"
end