Sha256: 9c245007f76de400896052490f9f3cca719a0e2743040e01a765024ec5f2d6e8

Contents?: true

Size: 405 Bytes

Versions: 15

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

module RakeVault
  module TokenFile
    def self.write(json_string)
      json = JSON.parse(json_string)
      token = json['auth']['client_token']
      RakeVault::TokenFile.write_token_to_file(token)
    end

    def self.write_token_to_file(token)
      file = File.open(File.expand_path('~/.vault-token'), 'w')
      file.write(token)
      file.close
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rake_vault-0.5.0.pre.2 lib/rake_vault/token_file.rb
rake_vault-0.5.0.pre.1 lib/rake_vault/token_file.rb
rake_vault-0.4.0 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.6 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.5 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.4 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.3 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.2 lib/rake_vault/token_file.rb
rake_vault-0.3.0.pre.1 lib/rake_vault/token_file.rb
rake_vault-0.2.0 lib/rake_vault/token_file.rb
rake_vault-0.1.0.pre.14 lib/rake_vault/token_file.rb
rake_vault-0.1.0.pre.13 lib/rake_vault/token_file.rb
rake_vault-0.1.0.pre.12 lib/rake_vault/token_file.rb
rake_vault-0.1.0.pre.11 lib/rake_vault/token_file.rb
rake_vault-0.1.0.pre.10 lib/rake_vault/token_file.rb