Module: RakeVault::TokenFile
- Defined in:
- lib/rake_vault/token_file.rb
Class Method Summary collapse
Class Method Details
.write(json_string) ⇒ Object
5 6 7 8 9 |
# File 'lib/rake_vault/token_file.rb', line 5 def self.write(json_string) json = JSON.parse(json_string) token = json['auth']['client_token'] RakeVault::TokenFile.write_token_to_file(token) end |
.write_token_to_file(token) ⇒ Object
11 12 13 14 15 |
# File 'lib/rake_vault/token_file.rb', line 11 def self.write_token_to_file(token) file = File.open(File.('~/.vault-token'), 'w') file.write(token) file.close end |