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
# File 'lib/boxen/keychain.rb', line 19

def initialize()
  @login = 
end

Instance Method Details

#passwordObject



23
24
25
# File 'lib/boxen/keychain.rb', line 23

def password
  get PASSWORD_SERVICE
end

#password=(password) ⇒ Object



27
28
29
# File 'lib/boxen/keychain.rb', line 27

def password=(password)
  set PASSWORD_SERVICE, password
end

#tokenObject



31
32
33
# File 'lib/boxen/keychain.rb', line 31

def token
  get TOKEN_SERVICE
end

#token=(token) ⇒ Object



35
36
37
# File 'lib/boxen/keychain.rb', line 35

def token=(token)
  set TOKEN_SERVICE, token
end