aws-profile_parser 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/aws-profile_parser.gemspec +1 -1
- data/lib/aws/profile_parser.rb +3 -2
- data/lib/aws/profile_parser/version.rb +1 -1
- data/spec/data/awsconfig.sample +2 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ffe57cf0d48356644f5e45fd9a8ff235d12d02b
|
4
|
+
data.tar.gz: f41c1740aac5d8c663c201d785bee8bc95f2129d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18f0801d0d4625b42f897f2d9a19e4697f1e8eb170a22f8a948ad438504a98414e27af287749d3ed79a10ea8c1ff0acaee60feee28851d5760ce5f45138a3ebc
|
7
|
+
data.tar.gz: f9ce5c834cf72b9ffb3569a4844878730d89b1bbb45e993d72be32e083a2cbb04838e849055343997bcef18048fabc35e32db4ef58859c040bba18b0ae3f0281
|
data/README.md
CHANGED
data/aws-profile_parser.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "aws-profile_parser"
|
8
8
|
spec.version = AWS::ProfileParser::VERSION
|
9
9
|
spec.authors = ["Masao Mochizuki"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["mochizukimasao.030@gmail.com"]
|
11
11
|
spec.summary = %q{Parse AWS CLI $AWS_CONFIG_FILE setting in Ruby}
|
12
12
|
spec.description = %q{Parse AWS CLI $AWS_CONFIG_FILE setting in Ruby}
|
13
13
|
spec.homepage = "https://github.com/masaomoc/aws-profile_parser/"
|
data/lib/aws/profile_parser.rb
CHANGED
@@ -4,7 +4,7 @@ module AWS
|
|
4
4
|
class ProfileParser
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
@file = ENV['AWS_CONFIG_FILE']
|
7
|
+
@file = ENV['AWS_CONFIG_FILE'] || ENV['HOME'] + "/.aws/config"
|
8
8
|
@credentials = nil
|
9
9
|
end
|
10
10
|
|
@@ -19,13 +19,14 @@ module AWS
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def parse
|
22
|
-
section = {
|
22
|
+
section = {}
|
23
23
|
current = {}
|
24
24
|
s = StringScanner.new(File.read(@file))
|
25
25
|
|
26
26
|
while !s.eos?
|
27
27
|
case
|
28
28
|
when s.scan(/\s+/)
|
29
|
+
when s.scan(/^#.*/)
|
29
30
|
# do nothing
|
30
31
|
when s.scan(/\[(profile\s+)?(.+?)\]/)
|
31
32
|
# strip 'profile' from each profile key and set to section key
|
data/spec/data/awsconfig.sample
CHANGED
@@ -4,6 +4,7 @@ aws_secret_access_key = yyyyyyyyyyyyyyy
|
|
4
4
|
region = us-east-1
|
5
5
|
|
6
6
|
[profile foobar]
|
7
|
+
# aws_access_key_id = AKIAYYYYYYYYYYYYYY
|
8
|
+
# aws_secret_access_key = 23563423hhhhhh
|
7
9
|
aws_access_key_id = AKIAYYYYYYYYYYYYYY
|
8
|
-
aws_secret_access_key = 23563423hhhhhh
|
9
10
|
region = ap-northeast-1
|
metadata
CHANGED
@@ -1,67 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-profile_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masao Mochizuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Parse AWS CLI $AWS_CONFIG_FILE setting in Ruby
|
56
56
|
email:
|
57
|
-
-
|
57
|
+
- mochizukimasao.030@gmail.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .rspec
|
64
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
65
|
- Gemfile
|
66
66
|
- LICENSE.txt
|
67
67
|
- README.md
|
@@ -82,12 +82,12 @@ require_paths:
|
|
82
82
|
- lib
|
83
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|