Class: Boxen::Keychain

Inherits:
Object
  • Object
show all
Defined in:
lib/boxen/keychain.rb

Constant Summary collapse

HELPER =

The keychain proxy we use to provide isolation and a friendly message in security prompts.

File.expand_path "../../../script/Boxen", __FILE__
PASSWORD_SERVICE =

The service name to use when loading/saving passwords.

"GitHub Password"
TOKEN_SERVICE =

The service name to use when loading/saving API keys.

"GitHub API Token"

Instance Method Summary collapse

Constructor Details

#initialize(login) ⇒ Keychain

Returns a new instance of Keychain.



19
20
21
22
23
# File 'lib/boxen/keychain.rb', line 19

def initialize()
  @login = 
  # Clear the password. We're storing tokens now.
  set PASSWORD_SERVICE, ""
end

Instance Method Details

#tokenObject



25
26
27
# File 'lib/boxen/keychain.rb', line 25

def token
  get TOKEN_SERVICE
end

#token=(token) ⇒ Object



29
30
31
# File 'lib/boxen/keychain.rb', line 29

def token=(token)
  set TOKEN_SERVICE, token
end