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 +4 -4
- data/lib/aws_cred_vault/toml.rb +6 -0
- data/lib/aws_cred_vault/version.rb +1 -1
- data/spec/lib/aws_cred_vault/toml_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0aa5ed953337c4a954542306707370e9ac59cca
|
4
|
+
data.tar.gz: 64516742393e90f02e44bb4401d94e324565eab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5147e87c44104387bd10da6930d88984bb462e6feddec77d43647c049b3316c75215989a83838e29f8d2a9a3bc151323d664e9c132f7262c7b9bb29ae77db25c
|
7
|
+
data.tar.gz: 01dd677a48499314a04b0c5742aaca7417973527b3f136c5b0d0fc7e1835431a45f30d0c882bff68d677efeec9cc62b1e7cdf8f19618ff0dad93d75057b51606
|
data/lib/aws_cred_vault/toml.rb
CHANGED
@@ -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
|
@@ -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
|
+
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-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml
|