piculet 0.2.8.beta → 0.2.8.beta2

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: 964c624907487d13b2db743957f28a4d6e20e94c
4
- data.tar.gz: 744750153bd12e4cda705d5c8b66042a17246d05
3
+ metadata.gz: 40ae2c7f93e346be9dfd8441fc3eed416119e780
4
+ data.tar.gz: 14b694efdd59ac8c639405d80e64c6bda1215f1c
5
5
  SHA512:
6
- metadata.gz: d2a3df7fed7c6ca29e38f197ed03e2de54b00f305bdb76b014b0b42ff1cdc4f257e4209f8c33d5fda0347383774bb92eb1a8d97159f2d530880fe93568de2947
7
- data.tar.gz: 651d72e1ed2e96c8a04288b1494748c6f006369891993cf2f3d6cd40b5fa4da3a7e64b88abc5ce18aecb3f047b04bff531823cd29742a4af4d2f5702783d82c4
6
+ metadata.gz: 31a6daa0c72c14312432bb19e91508bc80fa6a87277ed324b6bbb9358bb36f64901fa9254b1d64709c7ec483b2d79186aeffca0d30fedbe225ce9850ca67b954
7
+ data.tar.gz: 683ad448de1d67ad28cdf2f0d0ba38726c392e34e0c22090bee86b7f48eedf6c6834619b939a1aa6b31863a19dd8415c8e885704fe02c5846c910d66ecd97843
@@ -16,10 +16,10 @@ MAGIC_COMMENT = <<-EOS
16
16
  EOS
17
17
 
18
18
  options = {
19
- :dry_run => false,
20
- :format => :json,
21
- :color => true,
22
- :debug => false,
19
+ :dry_run => false,
20
+ :format => :ruby,
21
+ :color => true,
22
+ :debug => false,
23
23
  }
24
24
 
25
25
  ARGV.options do |opt|
@@ -29,24 +29,25 @@ ARGV.options do |opt|
29
29
  region = nil
30
30
  profile_name = nil
31
31
  credentials_path = nil
32
-
33
- opt.on('-p', '--profile PROFILE_NAME') {|v| profile_name = v }
34
- opt.on('' , '--credentials-path PATH') {|v| credentials_path = v }
35
- opt.on('-k', '--access-key ACCESS_KEY') {|v| access_key = v }
36
- opt.on('-s', '--secret-key SECRET_KEY') {|v| secret_key = v }
37
- opt.on('-r', '--region REGION') {|v| region = v }
38
- opt.on('-a', '--apply') {|v| mode = :apply }
39
- opt.on('-f', '--file FILE') {|v| file = v }
40
- opt.on('-n', '--names SG_LIST', Array) {|v| options[:sg_names] = v }
41
- opt.on('-x', '--exclude SG_LIST', Array) {|v| options[:exclude_sgs] = v }
42
- opt.on('', '--ec2s VPC_IDS', Array) {|v| options[:ec2s] = v }
43
- opt.on('', '--dry-run') {|v| options[:dry_run] = true }
44
- opt.on('-e', '--export') {|v| mode = :export }
45
- opt.on('-o', '--output FILE') {|v| output_file = v }
46
- opt.on('', '--split') {|v| split = true }
47
- opt.on('', '--format=FORMAT', [:ruby, :json]) {|v| options[:format] = v }
48
- opt.on('' , '--no-color') { options[:color] = false }
49
- opt.on('' , '--debug') { options[:debug] = true }
32
+ format_passed = false
33
+
34
+ opt.on('-p', '--profile PROFILE_NAME') {|v| profile_name = v }
35
+ opt.on('' , '--credentials-path PATH') {|v| credentials_path = v }
36
+ opt.on('-k', '--access-key ACCESS_KEY') {|v| access_key = v }
37
+ opt.on('-s', '--secret-key SECRET_KEY') {|v| secret_key = v }
38
+ opt.on('-r', '--region REGION') {|v| region = v }
39
+ opt.on('-a', '--apply') {|v| mode = :apply }
40
+ opt.on('-f', '--file FILE') {|v| file = v }
41
+ opt.on('-n', '--names SG_LIST', Array) {|v| options[:sg_names] = v }
42
+ opt.on('-x', '--exclude SG_LIST', Array) {|v| options[:exclude_sgs] = v }
43
+ opt.on('', '--ec2s VPC_IDS', Array) {|v| options[:ec2s] = v }
44
+ opt.on('', '--dry-run') {|v| options[:dry_run] = true }
45
+ opt.on('-e', '--export') {|v| mode = :export }
46
+ opt.on('-o', '--output FILE') {|v| output_file = v }
47
+ opt.on('', '--split') {|v| split = true }
48
+ opt.on('', '--format=FORMAT', [:ruby, :json]) {|v| format_passed = true; options[:format] = v }
49
+ opt.on('' , '--no-color') { options[:color] = false }
50
+ opt.on('' , '--debug') { options[:debug] = true }
50
51
  opt.parse!
51
52
 
52
53
  aws_opts = {}
@@ -76,6 +77,9 @@ ARGV.options do |opt|
76
77
  end
77
78
  end
78
79
 
80
+ if not format_passed and [file, output_file].any? {|i| i =~ /\.json\z/ }
81
+ options[:format] = :json
82
+ end
79
83
  rescue => e
80
84
  $stderr.puts("[ERROR] #{e.message}")
81
85
  exit 1
@@ -5,7 +5,7 @@ require 'set'
5
5
  require 'singleton'
6
6
  require 'term/ansicolor'
7
7
 
8
- require 'aws-sdk'
8
+ require 'aws-sdk-v1'
9
9
 
10
10
  require 'piculet/ext/ec2-owner-id-ext'
11
11
  require 'piculet/ext/security-group'
@@ -1,3 +1,3 @@
1
1
  module Piculet
2
- VERSION = "0.2.8.beta"
2
+ VERSION = "0.2.8.beta2"
3
3
  end
metadata CHANGED
@@ -1,25 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piculet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8.beta
4
+ version: 0.2.8.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: aws-sdk
14
+ name: aws-sdk-v1
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.48.0
20
- - - <
21
- - !ruby/object:Gem::Version
22
- version: 2.0.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +24,6 @@ dependencies:
27
24
  - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.48.0
30
- - - <
31
- - !ruby/object:Gem::Version
32
- version: 2.0.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: term-ansicolor
35
29
  requirement: !ruby/object:Gem::Requirement