sparkle_formation 3.0.24 → 3.0.26
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/sparkle_formation/function_struct.rb +19 -2
- data/lib/sparkle_formation/sparkle.rb +10 -1
- data/lib/sparkle_formation/sparkle_attribute/aws.rb +4 -4
- data/lib/sparkle_formation/sparkle_formation.rb +5 -3
- data/lib/sparkle_formation/sparkle_struct.rb +8 -4
- data/lib/sparkle_formation/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f948df7a83782e8ab90fd9900cae9e88e5e4bb
|
4
|
+
data.tar.gz: 9329bf4f33788f8ad4589828f1a38ace0c3c0af7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63f3a963ac6233c943c897df5e9d462933384060e42e6beb00a6502186a3f35f6e97659a66b757e60d48a3b44322bc31f8bd2bb5a5dd5a37262db3fbcc2f55c8
|
7
|
+
data.tar.gz: 35ede30d5db9519d4d8c41db21119d4d9de5328ce525f41d086f583a6212b7a2a3a5102feb9579a537c1a1f56f5a4128f04dbbcf29f7808a1d172c559aa60ac6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# v3.0.26
|
2
|
+
* Allow Fn::Sub helper to accept no arguments
|
3
|
+
* Fix Ruby 2.4 deprecation warnings
|
4
|
+
* Only store compile state when value is set
|
5
|
+
* Fix FunctionStruct clone behavior for Azure
|
6
|
+
* Lookup resources for taggable? helper through loaded provider
|
7
|
+
|
1
8
|
# v3.0.24
|
2
9
|
* Update value storage to handle FunctionStruct usage
|
3
10
|
* Add Complex data type to allowed compile time parameter types
|
@@ -29,9 +29,25 @@ class SparkleFormation
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
32
|
+
# Create a clone of this instance
|
33
33
|
def _clone(*_)
|
34
|
-
|
34
|
+
new_inst = _klass_new(_fn_name, *_fn_args)
|
35
|
+
new_inst._data.replace(__hashish[
|
36
|
+
@table.map{ |_key, _value|
|
37
|
+
if(_key.is_a?(::AttributeStruct))
|
38
|
+
_key = _key._clone
|
39
|
+
else
|
40
|
+
_key = _do_dup(_key)
|
41
|
+
end
|
42
|
+
if(_value.is_a?(::AttributeStruct))
|
43
|
+
_value = _value._clone
|
44
|
+
else
|
45
|
+
_value = _do_dup(_value)
|
46
|
+
end
|
47
|
+
[_key, _value]
|
48
|
+
}
|
49
|
+
])
|
50
|
+
new_inst
|
35
51
|
end
|
36
52
|
|
37
53
|
# @return [Numeric] hash value for instance
|
@@ -138,6 +154,7 @@ class SparkleFormation
|
|
138
154
|
suffix
|
139
155
|
end
|
140
156
|
end
|
157
|
+
alias_method :_sparkle_dump, :_dump
|
141
158
|
|
142
159
|
# Join arguments into a string for remote evaluation
|
143
160
|
#
|
@@ -108,9 +108,18 @@ class SparkleFormation
|
|
108
108
|
|
109
109
|
# NOTE: Enable access to top level constants but do not
|
110
110
|
# include deprecated constants to prevent warning outputs
|
111
|
+
deprecated_constants = [
|
112
|
+
:Config,
|
113
|
+
:TimeoutError,
|
114
|
+
:Fixnum,
|
115
|
+
:Bignum,
|
116
|
+
:NIL,
|
117
|
+
:TRUE,
|
118
|
+
:FALSE
|
119
|
+
]
|
111
120
|
::Object.constants.each do |const|
|
112
121
|
unless(self.const_defined?(const)) # rubocop:disable Style/RedundantSelf
|
113
|
-
next if const
|
122
|
+
next if deprecated_constants.include?(const)
|
114
123
|
self.const_set(const, ::Object.const_get(const)) # rubocop:disable Style/RedundantSelf
|
115
124
|
end
|
116
125
|
end
|
@@ -42,9 +42,9 @@ class SparkleFormation
|
|
42
42
|
# @param string [String, Hash] string to apply substitution
|
43
43
|
# @param variables [Hash] key value mappings for substitution
|
44
44
|
# @return [Hash]
|
45
|
-
def _cf_sub(string, variables)
|
46
|
-
__t_hashish(variables)
|
47
|
-
{'Fn::Sub' => [string, variables]}
|
45
|
+
def _cf_sub(string, variables = nil)
|
46
|
+
__t_hashish(variables) if variables
|
47
|
+
{'Fn::Sub' => [string, variables].compact}
|
48
48
|
end
|
49
49
|
alias_method :_sub, :_cf_sub
|
50
50
|
alias_method :sub!, :_cf_sub
|
@@ -329,7 +329,7 @@ class SparkleFormation
|
|
329
329
|
# @return [TrueClass, FalseClass] resource can be tagged
|
330
330
|
def taggable?
|
331
331
|
if(self[:type])
|
332
|
-
resource = _self.lookup(self[:type].gsub('::', '_').downcase)
|
332
|
+
resource = _self._provider._resources.lookup(self[:type].gsub('::', '_').downcase)
|
333
333
|
resource && resource[:properties].include?('Tags')
|
334
334
|
else
|
335
335
|
if(_parent)
|
@@ -689,8 +689,8 @@ class SparkleFormation
|
|
689
689
|
# @option args [Hash] :state local state parameters
|
690
690
|
# @return [SparkleStruct]
|
691
691
|
def compile(args={})
|
692
|
-
if(args.key?(:state))
|
693
|
-
@compile_state = args[:state]
|
692
|
+
if(args.key?(:state) && args.is_a?(Hash))
|
693
|
+
@compile_state = args[:state].to_smash
|
694
694
|
unmemoize(:compile)
|
695
695
|
end
|
696
696
|
memoize(:compile) do
|
@@ -758,7 +758,9 @@ class SparkleFormation
|
|
758
758
|
storage_compile_state[param_key] = compile_state[param_key]
|
759
759
|
end
|
760
760
|
end
|
761
|
-
|
761
|
+
unless(storage_compile_state.empty?)
|
762
|
+
compiled.outputs.compile_state.value MultiJson.dump(storage_compile_state)
|
763
|
+
end
|
762
764
|
compiled
|
763
765
|
end
|
764
766
|
|
@@ -123,11 +123,15 @@ class SparkleFormation
|
|
123
123
|
else
|
124
124
|
sym = function_bubbler(sym)
|
125
125
|
end
|
126
|
-
#
|
126
|
+
# When setting an AttributeStruct type instance check parent or context if
|
127
|
+
# available and reset if it has been moved.
|
127
128
|
if(@table[sym].is_a?(::AttributeStruct))
|
128
|
-
if(@table[sym].
|
129
|
-
@table[sym]
|
130
|
-
|
129
|
+
if(@table[sym].is_a?(::SparkleFormation::FunctionStruct))
|
130
|
+
if(@table[sym].respond_to?(:_fn_context) && @table[sym]._fn_context != self)
|
131
|
+
@table[sym] = @table[sym]._clone
|
132
|
+
@table[sym]._fn_context = self
|
133
|
+
end
|
134
|
+
elsif(@table[sym]._parent != self)
|
131
135
|
@table[sym]._parent(self)
|
132
136
|
end
|
133
137
|
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.
|
4
|
+
version: 3.0.26
|
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-
|
11
|
+
date: 2017-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attribute_struct
|
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
251
|
rubyforge_project:
|
252
|
-
rubygems_version: 2.
|
252
|
+
rubygems_version: 2.6.11
|
253
253
|
signing_key:
|
254
254
|
specification_version: 4
|
255
255
|
summary: Orchestration Template Generator
|