aws-ec2-instance_types 1.3.1 → 1.4.0

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: a65bc623f999bd670af5133c4c90605e63502d99
4
- data.tar.gz: d68e8e984d8dd074cb4a7b0a587e20fc96a69cbd
3
+ metadata.gz: 296a86c6c9f1a27ff7f04ecc94a41e54877252b3
4
+ data.tar.gz: 5e335f7cfb8188b3eb996050caf8c85577167827
5
5
  SHA512:
6
- metadata.gz: 1d32fdb6191a39ec204ae2ffdfd11eaf623e16b79d9a85c0f51972af2fd9c6ecc0558fda868e8aec314eb3b68770e87ce769451480cf9ce1e30df88f729e2ecb
7
- data.tar.gz: 5f45998c7a02a745943c5a96c59462f9e9595300df7727f88976cdd288642804381f73363d198e5eb6ff0bf0e4529a45e3b58f78d483f8bd0b9a0cf6db36bb61
6
+ metadata.gz: 3463e440d24644218ca492fdcb7f106fb720f2a4788706a59d7889a5b957cfcc08124aed2a34f94e46c31d7b8939ef842db91e92aac5ecfe5bbf13d55687d5e2
7
+ data.tar.gz: 86449e0c5ef9afa146799bc6462f6c264db621f3eeb713f96e5f633aa5c0c45a763aace3dd38de25f28c622e1028c6ff39fdde88ec229c6d812b4354928b08f5
@@ -16,6 +16,8 @@ module DLDInternet
16
16
  class_option :debug, :type => :boolean
17
17
  class_option :log_level, :type => :string, :banner => 'Log level ([:trace, :debug, :info, :step, :warn, :error, :fatal, :todo])'
18
18
  class_option :inifile, :type => :string
19
+ class_option :help, :type => :boolean
20
+ class_option :format, :type => :string, :default => 'pretty', :banner => '[:pretty, :yaml, :json]'
19
21
 
20
22
  no_commands do
21
23
 
@@ -41,7 +43,15 @@ module DLDInternet
41
43
  parse_options
42
44
  puts 'get instance types' if options[:verbose]
43
45
 
44
- puts DLDInternet::AWS::EC2::Instance_Types.getEC2_Instance_Types().ai
46
+ it = DLDInternet::AWS::EC2::Instance_Types.getEC2_Instance_Types()
47
+ case options[:format]
48
+ when /yaml/
49
+ puts it.to_yaml line_width: 1024, indentation: 4, canonical: false
50
+ when /json/
51
+ puts JSON.pretty_generate( it, { indent: "\t", space: ' '})
52
+ else
53
+ puts it.ai
54
+ end
45
55
  0
46
56
  end
47
57
 
@@ -32,7 +32,8 @@ module DLDInternet
32
32
  when /json/
33
33
  f.write JSON.pretty_generate(it, { indent: "\t", space: ' '})
34
34
  else
35
- abort! "Internal: Unsupported format #{format}. Should have noticed this earlier!"
35
+ f.write YAML::dump(it)
36
+ # abort! "Unsupported save format #{format}!"
36
37
  end
37
38
  f.close
38
39
  end
@@ -48,14 +49,15 @@ module DLDInternet
48
49
  case format
49
50
  when /json/
50
51
  JSON.parse(spec)
51
- when /yaml/
52
+ #when /yaml/
53
+ else
52
54
  begin
53
55
  YAML.load(spec)
54
56
  rescue Psych::SyntaxError => e
55
57
  abort! "Error in the template specification: #{e.message}\n#{spec.split(/\n/).map{|l| "#{i+=1}: #{l}"}.join("\n")}"
56
58
  end
57
- else
58
- abort! "Unsupported file type: #{path}"
59
+ # else
60
+ # abort! "Unsupported file type: #{path}"
59
61
  end
60
62
  end
61
63
 
@@ -28,6 +28,10 @@ module DLDInternet
28
28
  end
29
29
 
30
30
  def parse_options
31
+ if options[:help]
32
+ Cli.start(['help'])
33
+ exit 0
34
+ end
31
35
  validate_options
32
36
 
33
37
  lcs = ::Logging::ColorScheme.new( 'compiler', :levels => {
@@ -3,7 +3,7 @@ module DLDInternet
3
3
  module EC2
4
4
  module Instance_Types
5
5
  # aws-ec2-instance_types version
6
- VERSION = '1.3.1'
6
+ VERSION = '1.4.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ec2-instance_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christo De Lange
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler