aws_cred_vault 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1170491157740ec6045ff249d72fbaf44bc6c748
4
- data.tar.gz: 26e51cbd03e59cef0f5e67982734c3a5911304b4
3
+ metadata.gz: c0aa5ed953337c4a954542306707370e9ac59cca
4
+ data.tar.gz: 64516742393e90f02e44bb4401d94e324565eab9
5
5
  SHA512:
6
- metadata.gz: 4052ff60015734e910ef7e8da6331e0711ca427755fb7b6db41eb4f7c3a1c8537f68c5b8c3b887e3f1283dea3f350334b56e513bbb1721dfd51326e7214c932d
7
- data.tar.gz: bcbc9dc1c3d66952e926f22e27ec97ca75e58a901a69b5a9b270f29a66f204f7b747aa31353282e60f97b5736315e4d057fb2a4e49d8740b8fe0b3abcbc9dd2c
6
+ metadata.gz: 5147e87c44104387bd10da6930d88984bb462e6feddec77d43647c049b3316c75215989a83838e29f8d2a9a3bc151323d664e9c132f7262c7b9bb29ae77db25c
7
+ data.tar.gz: 01dd677a48499314a04b0c5742aaca7417973527b3f136c5b0d0fc7e1835431a45f30d0c882bff68d677efeec9cc62b1e7cdf8f19618ff0dad93d75057b51606
@@ -8,6 +8,12 @@ module AwsCredVault
8
8
  @file = file
9
9
  end
10
10
 
11
+ # Returns the account with the matching name, or nil if none exists
12
+ def account name
13
+ accounts.detect { |x| x.name == name }
14
+ end
15
+
16
+ # Returns the list of all accounts in the vault
11
17
  def accounts
12
18
  account_hash.map do |name, user_list|
13
19
  account = Account.new name
@@ -1,3 +1,3 @@
1
1
  module AwsCredVault
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -59,4 +59,16 @@ describe AwsCredVault::Toml do
59
59
  end
60
60
  end
61
61
 
62
+ describe '#account' do
63
+ let(:file) { }
64
+ let(:vault) { AwsCredVault::Toml.new('spec/files/accounts.toml') }
65
+
66
+ it 'returns nil when no account exists' do
67
+ expect(vault.account('nope')).to be_nil
68
+ end
69
+
70
+ it 'returns an account when valid' do
71
+ expect(vault.account('protoss')).to be_a AwsCredVault::Account
72
+ end
73
+ end
62
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_cred_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clarke Brunsdon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-20 00:00:00.000000000 Z
11
+ date: 2014-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml