cfndsl 0.6.2 → 0.7.0

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
- MGJkNTA0ODkzM2Q1ZTA5ZjQxYzNiYWU5MmQwYTlhMmUyMDRkMjY2Nw==
4
+ NzBmYTE1Y2U0ZDJkZmY4OTg4MDI1NmIyMjQ0NTZiOGYxMzFmMjZhMg==
5
5
  data.tar.gz: !binary |-
6
- OGU0MjRiODc0MzJiYjIxNTZkZjk5MGIxZWI2Y2U3Y2Y2YzFkMjQ5NA==
6
+ MDgxYTVlNGExMDY5NGEwNzU1MDYzODVkYWMyMjdjYmUyYWIwYzNhMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjU0YTZlNjQ5YmJmNGE1YzRkNzEyMmFkMzVlMDcxZTUzMjQyMDRlZTM5ZTAz
10
- MTA5OTZlNjQxODVlMjBkYTllY2FmNDlkY2VhOTU4OTdjZjE0NTNmYTU1YmMy
11
- ZWU5MTIyZjdhY2VhMWVkYjhjOGRmZDAxNjJkYzI4NWY3NDI4YmY=
9
+ ZTE0ZTcwNDNmMjRiZWFhOTQ0NTZhY2VhNjU5ZmJhMTBlZDY1NDg2ZjhlOTI3
10
+ M2U3ODU2Njk2YzY1NWVjYWQwOWFhNDk5YzE0N2EzMjY2ZDQxOWRkM2Q1Mzdk
11
+ OTY0ZTY5YTBjMmY3NTc0Yzk0MDMwNmU2ODllNTJkMzMzZWMyMzA=
12
12
  data.tar.gz: !binary |-
13
- ODJlMGFmYjEyNzcwMzIyNGVjMTNmNDA1ZGEwMWIyMzcxNGNiMWE2NjE5ZmUw
14
- Zjk4NGFkYzlhZTk5MmRmODlmNGI4MjJiODY3ZGQxZjczN2QzZTg5NGMwZTk4
15
- NzVhYzJjZGQwYzE2OGUwYTBiZTc0ZWFjMzA4MTFiYjcwNmZjMDI=
13
+ YjhlM2NiYThlMGZkMmI5YzY0ZDg2ZTIzNjFmNWMxMjA3NzFmY2ZhMjdjZDVl
14
+ ZWJlMDVhNzkwZjA4MjdmNWM1NzhmOTQxZDU3NTM1ZTdiNzBhMWE4NTQwZTAx
15
+ MGUyY2NmZDA5MWZhMTMxMmM5MDA2OGZmNzlmMjQxMGJkMjk1ZmM=
@@ -118,8 +118,6 @@ module CfnDsl
118
118
  end
119
119
  else
120
120
  # Array version
121
- sing_name = CfnDsl::Plurals.singularize(pname)
122
- create_klass = type_module.const_get(ptype[0])
123
121
  klass.class_eval do
124
122
  CfnDsl.method_names(pname) do |method|
125
123
  define_method(method) do |*values, &block|
@@ -130,15 +128,23 @@ module CfnDsl
130
128
  @Properties[pname].value
131
129
  end
132
130
  end
131
+ end
133
132
 
134
- CfnDsl.method_names(sing_name) do |method|
135
- define_method(method) do |value = nil, &block|
136
- @Properties ||= {}
137
- @Properties[pname] ||= PropertyDefinition.new([])
138
- value = create_klass.new unless value
139
- @Properties[pname].value.push value
140
- value.instance_eval(&block) if block
141
- value
133
+ sing_name = CfnDsl::Plurals.singularize(pname)
134
+ create_klass = type_module.const_get(ptype[0])
135
+ sing_names = sing_name == pname ? [ptype[0]] : [ptype[0], sing_name]
136
+
137
+ klass.class_eval do
138
+ sing_names.each do |sname|
139
+ CfnDsl.method_names(sname) do |method|
140
+ define_method(method) do |value = nil, &block|
141
+ @Properties ||= {}
142
+ @Properties[pname] ||= PropertyDefinition.new([])
143
+ value = create_klass.new unless value
144
+ @Properties[pname].value.push value
145
+ value.instance_eval(&block) if block
146
+ value
147
+ end
142
148
  end
143
149
  end
144
150
  end
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = '0.6.2'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
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.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-19 00:00:00.000000000 Z
12
+ date: 2016-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler