sparkle_formation 3.0.22 → 3.0.24

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: 5859104b23538649891d59cfbb13e0074559def6
4
- data.tar.gz: 8cd95968b6fe6a2d959ad896675dd88d32700574
3
+ metadata.gz: 7f10d97f5400c05205b7164247b875d778ae0491
4
+ data.tar.gz: 6b3dd43d3cbd5a63117f03c7241bb47cc1fa3926
5
5
  SHA512:
6
- metadata.gz: 8ed5c62ff322bb1ca0234c6d46953f8150ff93f22227b3f93ecb35597bdb65908877c441252847f0204c9e5fb6f082731ae39fe2d60b674de7e68642bd16ddf6
7
- data.tar.gz: b2faee5e3a49d2148798a75763281a134b3a7382e57196576e5a4721b0fa2975e439b21727c746e15469f29c686592531f3efb95930416f6fba8f809dc8e99ae
6
+ metadata.gz: d7aafb751e1c143ac1e19fbb2b18965f66a7d7b92d6d5254495dc05603462bec8359d0866f7be643bb5603106e9be2352fd627e6669f13873d27c0d0e27a2dc6
7
+ data.tar.gz: 12e0402332fd2b41605847be8c10243648203a3e8d63facfe230cd86a3660f8e9a4335c9e51f76c4466a93e322f18ebd2fc5c43afcc3e69d51cc077a1ceb0e58
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v3.0.24
2
+ * Update value storage to handle FunctionStruct usage
3
+ * Add Complex data type to allowed compile time parameter types
4
+
1
5
  # v3.0.22
2
6
  * Add support for non-string like data keys (#217)
3
7
  * Customize compile time parameter setting (#218)
@@ -53,7 +53,7 @@ defining options for the parameter. The available items within the option
53
53
  |-----------------------|-------------|-----------------------------------------
54
54
  | `:type` | Description | Data type of parameter
55
55
  | | Required | yes
56
- | | Valid | `:number`, `:string`
56
+ | | Valid | `:number`, `:string`, `:complex`
57
57
  | | Default | none
58
58
  |-----------------------|-------------|-----------------------------------------
59
59
  | `:description` | Description | Description of the parameter
@@ -140,6 +140,28 @@ The resulting value when accessed will be:
140
140
  ]
141
141
  ~~~
142
142
 
143
+ ##### Complex type support
144
+
145
+ Complex types are supported but should rarely be used. Defining these types of compile
146
+ time parameters impose restrictions on templates and make them much less flexible. However,
147
+ there may be cases where providing a complex type to a template is ideal. It is important to
148
+ note these restrictions:
149
+
150
+ * No `:multiple` support
151
+ * No user defined input via sfn CLI
152
+ * No template serialization
153
+
154
+ The last restriction is extremely important. Compile time parameters are stored in a template's
155
+ outputs. This is done to support template reprocessing and change detection. Complex types are
156
+ not stored within the template output due to the fragility introduced by the dependency on the
157
+ complex type to properly serialize itself. The size of the serialization is also a concern which
158
+ can easily invalidate a template due to size restrictions given a sufficiently complex type.
159
+
160
+ In general complex types should never be used. Given a situation where complex types may seem
161
+ like the correct solution, re-evaluate the usage and determine no other solution can be implemented
162
+ to solve the problem. Compile time parameters already make templates less flexible and complex
163
+ types increases this rigidity.
164
+
143
165
  ##### Prompting when nested
144
166
 
145
167
  The `:prompt_when_nested` is used by implementations to suppress parameter prompts
@@ -597,7 +597,7 @@ class SparkleFormation
597
597
  'max_value', 'min_value'
598
598
  ]
599
599
  # Allowed data types for parameters
600
- VALID_GENERATION_PARAMETER_TYPES = ['String', 'Number']
600
+ VALID_GENERATION_PARAMETER_TYPES = ['String', 'Number', 'Complex']
601
601
 
602
602
  # Get or set the compile time parameter setting block. If a get
603
603
  # request the ancestor path will be searched to root
@@ -752,7 +752,13 @@ class SparkleFormation
752
752
  # @param compiled [AttributeStruct]
753
753
  # @return [AttributeStruct]
754
754
  def set_compiled_state(compiled)
755
- compiled.outputs.compile_state.value MultiJson.dump(compile_state)
755
+ storage_compile_state = Smash.new
756
+ parameters.each do |param_key, param_config|
757
+ if(param_config.fetch(:type, 'string').to_s.downcase.to_sym != :complex)
758
+ storage_compile_state[param_key] = compile_state[param_key]
759
+ end
760
+ end
761
+ compiled.outputs.compile_state.value MultiJson.dump(storage_compile_state)
756
762
  compiled
757
763
  end
758
764
 
@@ -123,11 +123,15 @@ class SparkleFormation
123
123
  else
124
124
  sym = function_bubbler(sym)
125
125
  end
126
- @table[sym] = function_bubbler(@table[sym])
127
126
  # Always reset parent in case this is a clone
128
127
  if(@table[sym].is_a?(::AttributeStruct))
129
- @table[sym]._parent(self)
128
+ if(@table[sym]._parent.nil?)
129
+ @table[sym] = @table[sym]._clone
130
+ else
131
+ @table[sym]._parent(self)
132
+ end
130
133
  end
134
+ @table[sym] = function_bubbler(@table[sym])
131
135
  @table[sym]
132
136
  end
133
137
 
@@ -1,5 +1,5 @@
1
1
  # Unicorns and rainbows
2
2
  class SparkleFormation
3
3
  # Current library version
4
- VERSION = Gem::Version.new('3.0.22')
4
+ VERSION = Gem::Version.new('3.0.24')
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparkle_formation
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.22
4
+ version: 3.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-14 00:00:00.000000000 Z
11
+ date: 2017-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct