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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 034997ba85838ff60db49c955ea8b4f4405f5c33
4
- data.tar.gz: 56411d4aa19bb9b7b8ee338f3ad7d2c986b39998
3
+ metadata.gz: 652a0aab48afeb4087fec44d53eab1c63ae00eaa
4
+ data.tar.gz: 8a8f6c5f92f253a54cc7763f6ae74cb04dd7d7a4
5
5
  SHA512:
6
- metadata.gz: 668a7efefa9faaed4c4382d1f832f84ac7bc3f83ff8052f9a2660fa8119399c3cfcf4980b6acc7afa07036f800f5d781a8da146072e9ad549fb4bd785bbc0902
7
- data.tar.gz: 500a4bc5dfabb60a656e30773c3a2c4449899c4dc5b134ae57f0ad3c920f868745b9ff7547b082aed2002f152f586fa2000743c1e47bf0f0125d8d2f8d2d3047
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 = { access_key_id: 'xxxxx', secret_access_key: 'xxxxx', region: 'ap-northeast-1' }
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?
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Soror
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soror
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - kirikiriyamama