cfndsl 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZThkNTZjYmU1ZTA5YTFkYjAwODJmMTMxNzFhZGY0YzQxMDJlZDgzMw==
4
+ MzU4MTYyNzZmODRjMmQ2YWUyOTQ1MjdhM2I1ZTcyMTJmMDU5OWZlYQ==
5
5
  data.tar.gz: !binary |-
6
- NjhjZGRkYWNkMTI5ZDlkMjY2MmYyMmI4MTRhZDk2ZWNjMGI0YjU4NA==
6
+ ZTcwOTY0N2JjZTFmZmJkYzIyZmQxN2Y0MTQ2MGMyZGJjNDI5NjU5Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Njc2OTRlNzUzN2JkYmZiNzYyYjRkMzgxOTI4NjA4ZmQ5MGRmZDA4YjBkYWYw
10
- OWQ3YmYwMzYyOTI0NjhiNzdhMGFiZDkyMzkzZDZkODVmNzBiMmQzNTY5YTQ0
11
- OWQzYTZmM2JmY2YwOWQ3YmQxYjRjODY4NDk0MjYwMzY4OTNjOTA=
9
+ ZTBiZGQ5ZWQ4ODcxZWFhMTkzODYxYzMxOGYzNDgzNGFmN2MyODhiNmQxZGNi
10
+ YWVkZWQ1YjI2MDA2MTM2ZGFlMjM4YmQ4ZmI3ZmE3NjFmMWEzOTY3NDI1ODQw
11
+ NWY0NjlkNzA0NGNmNTRkZmU4MmVhMDlkNWNlYjIxYjk3Nzg2OTk=
12
12
  data.tar.gz: !binary |-
13
- OGJhN2FjNzIyNTBmMzg5Yzk3NzVlMzFiYzAzNjljNjY1YmI0NjVlMjRjODc0
14
- MTg5ZDUyZWNkZTEyM2EzNWUzMWRkYjc1OTY1MDNhZWZmZGY3YTcxODhjZTE4
15
- YWE1YzM4NDVhYTRhM2Y3ZmRkNDIyNjk1OWZhODU1NTQyM2Q5MDI=
13
+ NzJkYWMxNGE0YTcwYzA4MzFhZDhlOTM3ZjNlODY1NmMzYjc2MjIxMTU2MTVh
14
+ MmViNTE5NzQ5MDgyM2IyYzg3NTY4ODNiYjllZGUyZWUwNmI3MmFiODdjYjY4
15
+ NWQwMzAwNDJmMjIwZThiNmZiYTM3ZTJlYThiMzk2NzkyOGY4NjQ=
@@ -66,7 +66,7 @@ module CfnDsl
66
66
  def FnNot(value)
67
67
  ##
68
68
  # Equivalent to the Cloudformation template built in function Fn::Not
69
- Fn.new("Not", value)
69
+ Fn.new("Not", [value].flatten.compact)
70
70
  end
71
71
 
72
72
  def FnOr(array)
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/spec/cfndsl_spec.rb CHANGED
@@ -100,6 +100,21 @@ describe CfnDsl::CloudFormationTemplate do
100
100
  expect(refs).to have_key('X')
101
101
  end
102
102
 
103
+ context 'FnNot' do
104
+ let(:data) { "test" }
105
+ let(:expected) { "{\"Fn::Not\":[\"#{data}\"]}" }
106
+
107
+ it 'formats correctly' do
108
+ func = subject.FnNot data
109
+ expect(func.to_json).to eq expected
110
+ end
111
+
112
+ it 'flattens existing array' do
113
+ func = subject.FnNot [data]
114
+ expect(func.to_json).to eq expected
115
+ end
116
+ end
117
+
103
118
  it 'FnBase64' do
104
119
  func = subject.FnBase64 'A'
105
120
  expect(func.to_json).to eq('{"Fn::Base64":"A"}')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfndsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack