soror 0.0.5 → 0.0.6
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 +4 -2
- data/bin/soror +2 -1
- data/lib/soror.rb +2 -9
- data/lib/soror/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 652a0aab48afeb4087fec44d53eab1c63ae00eaa
|
4
|
+
data.tar.gz: 8a8f6c5f92f253a54cc7763f6ae74cb04dd7d7a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93f95b5a76f7fb6038343e9b6fd09164151742601c2f002b50627fc7aa3056804d547111863107f1f4e1aac8818cbc8adeb2470c6bf46d3d8b414b5cc7f7a8b5
|
7
|
+
data.tar.gz: 6b30479714b67d791099a1eeadda4e3501a1cb26072f9f09346fb4794ed3f37064af1557a319770d1bdd2af70223dd448527b0c409af6dc4d2965bab85f6b38c
|
data/README.md
CHANGED
@@ -30,13 +30,13 @@ Soror::EC2::Instance.search_by(name: 'soror') #=> [<Aws::EC2::Instance>, ...]
|
|
30
30
|
### Configuration
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
Soror.config
|
33
|
+
Soror.config.update(access_key_id: 'xxxxx', secret_access_key: 'xxxxx', region: 'ap-northeast-1')
|
34
34
|
```
|
35
35
|
|
36
36
|
Or put the configuration file on your home directory as:
|
37
37
|
|
38
38
|
```sh
|
39
|
-
cat <<EOS >$HOME/.soror
|
39
|
+
$ cat <<EOS >$HOME/.soror
|
40
40
|
access_key_id: 'xxxxx'
|
41
41
|
secret_access_key: 'xxxxx'
|
42
42
|
region: 'ap-northeast-1'
|
@@ -46,6 +46,7 @@ EOS
|
|
46
46
|
## CLI
|
47
47
|
|
48
48
|
```
|
49
|
+
$ soror --help
|
49
50
|
Usage: soror [options]
|
50
51
|
-t, --tag='KEY=VALUE'
|
51
52
|
-a, --attributes=ATTR,ATTR,...
|
@@ -53,6 +54,7 @@ Usage: soror [options]
|
|
53
54
|
--access-key=KEY
|
54
55
|
--secret-key=KEY
|
55
56
|
--region=REGION
|
57
|
+
-v, --version
|
56
58
|
```
|
57
59
|
|
58
60
|
## Required permissions
|
data/bin/soror
CHANGED
@@ -15,13 +15,14 @@ OptionParser.new do |opt|
|
|
15
15
|
opt.on('--access-key=KEY') { |v| options[:config][:access_key_id] = v }
|
16
16
|
opt.on('--secret-key=KEY') { |v| options[:config][:secret_access_key] = v }
|
17
17
|
opt.on('--region=REGION') { |v| options[:config][:region] = v }
|
18
|
+
opt.on('-v', '--version') { puts "soror #{Soror::VERSION}"; exit }
|
18
19
|
opt.parse!(ARGV)
|
19
20
|
end
|
20
21
|
fail OptionParser::MissingArgument, '--tag' if options[:tag].empty?
|
21
22
|
fail OptionParser::MissingArgument, '--attributes' if options[:attributes].nil?
|
22
23
|
fail OptionParser::InvalidArgument, '--attributes' if options[:attributes].empty?
|
23
24
|
|
24
|
-
Soror.config(options[:config])
|
25
|
+
Soror.config.update(options[:config])
|
25
26
|
|
26
27
|
instances = Soror::EC2::Instance.search_by(options[:tag])
|
27
28
|
exit! if instances.empty?
|
data/lib/soror.rb
CHANGED
@@ -22,17 +22,10 @@ end
|
|
22
22
|
module Soror
|
23
23
|
class << self
|
24
24
|
extend Forwardable
|
25
|
-
def_delegators Aws, :config=
|
26
|
-
|
27
|
-
def config(hash)
|
28
|
-
warn '[DEPRECATION] `Soror.config` will be removed. Please use `Soror.config=` instead.'
|
29
|
-
hash.symbolize_keys.each{ |k, v| Aws.config[k] = v }
|
30
|
-
end
|
25
|
+
def_delegators Aws, :config, :config=
|
31
26
|
end
|
32
27
|
end
|
33
28
|
|
34
29
|
File.expand_path('~/.soror').tap do |path|
|
35
|
-
if File.exists?(path)
|
36
|
-
Soror.config = YAML.load_file(path).symbolize_keys
|
37
|
-
end
|
30
|
+
Soror.config.update(YAML.load_file(path).symbolize_keys) if File.exists?(path)
|
38
31
|
end
|
data/lib/soror/version.rb
CHANGED