rubycfn 0.3.1 → 0.3.2

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: eab8c8a943fdf2029c93db966b95036ccdc61ef2
4
- data.tar.gz: b4c956f4c40fbe78e08148f15444cf73cd9af4c4
3
+ metadata.gz: 0f25559943267a800e4f964a93dd295887662876
4
+ data.tar.gz: 1828ebf37d85a2901495890633889f18f6a9c9fa
5
5
  SHA512:
6
- metadata.gz: 7d3538ea7256620bf8de8a850b98198290a473af222361684560f6192802c1a137a4938c6ec66e37b88cea4c5378aaf7d33121ce5d48db37649e011a3eeeedf9
7
- data.tar.gz: ee06a42c32da3ec67cb2910381f7770ee2dee8ee78fc4bd33826e8379c009ccefe6e7bcca99532526e2c066422114256ac2e13fcb7501981fec8698b9c0b067b
6
+ metadata.gz: 0048040b6bc29923c05f98bb38d0dda8e87852df009c9f2c69655a2576c09f580576f6fca5449e02570dcbb52e4c19b5b42830d521fe92f533ff075ea1d6764c
7
+ data.tar.gz: 3342cbb4ed4070d9dfbfb5439231f656dbe50b7fd58dd41b75e3d879ef789113876e7b6f52265cf45fa4f484bfa34ea1df5007e399c44603947ca235cbb966ed
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
  /doc/
10
10
  .ruby-version
11
11
  /test-reports
12
+ CloudFormationResourceSpecification.json
13
+ generated.rb
14
+ /attic
data/CHANGELOG.md CHANGED
@@ -2,7 +2,10 @@
2
2
  All notable changes to Rubycfn will be documented in this file.
3
3
  This project uses [Semantic Versioning](http://semver.org/).
4
4
 
5
- ## 0.3.2 (Next Release)
5
+ ## 0.3.3 (Next Release)
6
+
7
+ ## 0.3.2
8
+ * Added AWS::Serverless::Transform capability -- [@dennisvink][@dennisvink]
6
9
 
7
10
  ## 0.3.1
8
11
  * Fixed bug in VPC template generation -- [@dennisvink][@dennisvink]
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubycfn (0.3.1)
4
+ rubycfn (0.3.2)
5
5
  activesupport (~> 5.1.5)
6
6
  dotenv (~> 2.4.0)
7
7
  json (~> 2.1.0)
data/README.md CHANGED
@@ -413,6 +413,11 @@ module DemoStack
413
413
  end
414
414
  ```
415
415
 
416
+ ## Serverless Transforms
417
+
418
+ To allow for SAM transformation use the 'transform' method inside your template.
419
+ The transform method takes an optional argument, and defaults to "AWS::Serverless-2016-10-31"
420
+
416
421
  ## License
417
422
 
418
423
  MIT License
@@ -1,4 +1,4 @@
1
1
  # Rubycfn version
2
2
  module Rubycfn
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
data/lib/rubycfn.rb CHANGED
@@ -8,6 +8,7 @@ require "rubycfn/version"
8
8
 
9
9
  @depends_on = []
10
10
  @description = ""
11
+ @transform = ""
11
12
  @outputs = {}
12
13
  @parameters = {}
13
14
  @properties = {}
@@ -173,6 +174,12 @@ module Rubycfn
173
174
  end
174
175
  end
175
176
 
177
+ def self.transform(transform = "AWS::Serverless-2016-10-31")
178
+ unless transform.nil?
179
+ TOPLEVEL_BINDING.eval("@transform = '#{transform}'")
180
+ end
181
+ end
182
+
176
183
  def self.description(description = "")
177
184
  unless description.nil?
178
185
  TOPLEVEL_BINDING.eval("@description = '#{description}'")
@@ -358,6 +365,7 @@ module Rubycfn
358
365
  when "AWS"
359
366
  skeleton = { "AWSTemplateFormatVersion": "2010-09-09" }
360
367
  skeleton = JSON.parse(skeleton.to_json)
368
+ skeleton.merge!(Transform: TOPLEVEL_BINDING.eval("@transform"))
361
369
  skeleton.merge!(Description: TOPLEVEL_BINDING.eval("@description"))
362
370
  skeleton.merge!(Mappings: sort_json(TOPLEVEL_BINDING.eval("@mappings")))
363
371
  skeleton.merge!(Parameters: sort_json(TOPLEVEL_BINDING.eval("@parameters")))
@@ -367,6 +375,7 @@ module Rubycfn
367
375
  TOPLEVEL_BINDING.eval("@variables = @AWSresources = @outputs = @properties = @mappings = @parameters = {}")
368
376
  TOPLEVEL_BINDING.eval("@depends_on = []")
369
377
  TOPLEVEL_BINDING.eval("@description = ''")
378
+ TOPLEVEL_BINDING.eval("@transform = ''")
370
379
  JSON.pretty_generate(skeleton.recursive_compact)
371
380
  end
372
381
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycfn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Vink
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-10 00:00:00.000000000 Z
11
+ date: 2019-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: neatjson