aws-cfn-compiler 0.0.8 → 0.1.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: d4c8c959284b6eeb3ea842006bef5e84d757dd75
4
- data.tar.gz: 5b041c03ec96962c8c91fd8cce3e665ef7f1d49d
3
+ metadata.gz: 592aa0b88be9d7d1ad4cf61f894ea8b4cdbe66a1
4
+ data.tar.gz: a13ea148dd882a2cf11352cd0ceabc4d309afe6e
5
5
  SHA512:
6
- metadata.gz: e68bb6fe5d38440a517c70682a8e05d73fc1aa9eefb1f78067b90aa3c8e66056fab90aeb96a33081a2db93316e03d16f1864a4553a258c1ea4e74428dfa27a9a
7
- data.tar.gz: 8a5dd7da0e46dbb32a84054324b22646a8db0742f7256f9999a93d21488dc8e9bf462188a748457f2754b6cca263340ea308f85cc204fccd5fefb30c8a08dee7
6
+ metadata.gz: 1a707d5598d57e097bba7ed293058f459e3e3108255a0da1a542bde2446cf4ba4cd5c5e8dccbf27740a074e57885c814fb30625ce77ebaa3344a10c37c188098
7
+ data.tar.gz: 0e9fe3a2e7a54d848c57dc9029a7abe569865755beb299db9e4e16f99dae0f93ec224ad5323ae068cee9c3b6a5d5334299184a1a7f0cf0c67c981ae89a532da2
@@ -1,7 +1,7 @@
1
1
  module Aws
2
2
  module Cfn
3
3
  module Compiler
4
- VERSION = "0.0.8"
4
+ VERSION = "0.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -51,16 +51,16 @@ module Aws
51
51
  Outputs: @items['outputs'],
52
52
  }
53
53
 
54
- output_file = @opts[:output] || 'compiled.json'
55
- puts
56
- puts "Writing compiled file to #{output_file}..."
57
- save(compiled, output_file)
58
-
59
54
  puts
60
55
  puts 'Validating compiled file...'
61
56
 
62
57
  validate(compiled)
63
58
 
59
+ output_file = @opts[:output] || 'compiled.json'
60
+ puts
61
+ puts "Writing compiled file to #{output_file}..."
62
+ save(compiled, output_file)
63
+
64
64
  puts
65
65
  puts '*** Compiled Successfully ***'
66
66
  end
@@ -122,7 +122,7 @@ module Aws
122
122
  raise "Unable to open specification: #{abs}"
123
123
  end
124
124
  end
125
- %w{params mappings resources outputs}.each do |dir|
125
+ %w{Params Mappings Resources Outputs}.each do |dir|
126
126
  load_dir(dir,spec)
127
127
  end
128
128
  end
@@ -153,9 +153,18 @@ module Aws
153
153
 
154
154
  def load_dir(dir,spec=nil)
155
155
  puts "Loading #{dir}..."
156
- @items[dir] = {}
157
156
  raise "No such directory: #{@opts[:directory]}" unless File.directory?(@opts[:directory])
158
- (Dir[File.join(@opts[:directory], "#{dir}.*")] | Dir[File.join(@opts[:directory], dir, "**", "*")]).collect do |filename|
157
+ set = []
158
+ if File.directory?(File.join(@opts[:directory], dir))
159
+ @items[dir] = {}
160
+ set = get_file_set(dir)
161
+ else
162
+ if File.directory?(File.join(@opts[:directory], dir.downcase))
163
+ @items[dir] = {}
164
+ set = get_file_set(dir.downcase)
165
+ end
166
+ end
167
+ set.collect do |filename|
159
168
  next unless filename =~ /\.(json|ya?ml)\z/i
160
169
  if spec and spec[dir]
161
170
  base = File.basename(filename).gsub(%r/\.(rb|yaml)/, '')
@@ -183,6 +192,10 @@ module Aws
183
192
  end
184
193
  end
185
194
 
195
+ def get_file_set(dir)
196
+ Dir[File.join(@opts[:directory], "#{dir}.*")] | Dir[File.join(@opts[:directory], dir, "**", "*")]
197
+ end
198
+
186
199
  end
187
200
  end
188
201
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-cfn-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PKinney