sparkle_formation 3.0.28 → 3.0.30
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 +3 -0
- data/lib/sparkle_formation/sparkle.rb +129 -124
- data/lib/sparkle_formation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a29d3a6620a8273f91482119da653d55604be48e69c1e635efb439acb677fb3a
|
4
|
+
data.tar.gz: 707f5d92f16fe7209a2e95822b40e9fa289cbe438516bc22ed894bc9e0b88b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac01ee39bf5e43271bc658ca754c74d7667eebb739b305b9c335e5b203c9009504a6b9313d946d3b7a06abb45fd1ad5c520c83e7931c37d4c538d6eefd2646c5
|
7
|
+
data.tar.gz: aa7f5880c6c41d4a854f95023e0ee7e39a55bbb83f7050709d1abb0ce5daef7932b8284b8f61f9ecf2d5f709a3967c24ecdb20c4d384106627cf82fd96d6f6dc
|
data/CHANGELOG.md
CHANGED
@@ -4,128 +4,6 @@ require 'sparkle_formation'
|
|
4
4
|
class SparkleFormation
|
5
5
|
# Independent collection of SparkleFormation items
|
6
6
|
class Sparkle
|
7
|
-
|
8
|
-
# Evaluation context wrapper for loading SparkleFormation files
|
9
|
-
class EvalWrapper < BasicObject
|
10
|
-
|
11
|
-
# @!visibility private
|
12
|
-
def require(*args)
|
13
|
-
::Kernel.require(*args)
|
14
|
-
end
|
15
|
-
|
16
|
-
# @!visibility private
|
17
|
-
class SparkleFormation
|
18
|
-
attr_accessor :sparkle_path
|
19
|
-
|
20
|
-
class << self
|
21
|
-
def insert(*args, &block)
|
22
|
-
::SparkleFormation.insert(*args, &block)
|
23
|
-
end
|
24
|
-
|
25
|
-
def part_data(data = nil)
|
26
|
-
if data
|
27
|
-
@data = data
|
28
|
-
else
|
29
|
-
@data
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def dynamic(name, args = {}, &block)
|
34
|
-
part_data[:dynamic].push(
|
35
|
-
::Smash.new(
|
36
|
-
:name => name,
|
37
|
-
:block => block,
|
38
|
-
:args => ::Smash[
|
39
|
-
args.map(&:to_a)
|
40
|
-
],
|
41
|
-
:type => :dynamic,
|
42
|
-
)
|
43
|
-
).last
|
44
|
-
end
|
45
|
-
|
46
|
-
def build(&block)
|
47
|
-
part_data[:component].push(
|
48
|
-
::Smash.new(
|
49
|
-
:block => block,
|
50
|
-
:type => :component,
|
51
|
-
)
|
52
|
-
).last
|
53
|
-
end
|
54
|
-
|
55
|
-
def component(name, args = {}, &block)
|
56
|
-
part_data[:component].push(
|
57
|
-
::Smash.new(
|
58
|
-
:name => name,
|
59
|
-
:block => block,
|
60
|
-
:args => ::Smash[
|
61
|
-
args.map(&:to_a)
|
62
|
-
],
|
63
|
-
:type => :component,
|
64
|
-
)
|
65
|
-
).last
|
66
|
-
end
|
67
|
-
|
68
|
-
def dynamic_info(*args)
|
69
|
-
::Smash.new(:metadata => {}, :args => {})
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def initialize(*args)
|
74
|
-
opts = args.detect { |a| a.is_a?(Hash) } || {}
|
75
|
-
SparkleFormation.part_data[:template].push(
|
76
|
-
::Smash.new(
|
77
|
-
:name => args.first,
|
78
|
-
:args => opts,
|
79
|
-
)
|
80
|
-
)
|
81
|
-
raise ::TypeError
|
82
|
-
end
|
83
|
-
|
84
|
-
# @!visibility private
|
85
|
-
class Registry
|
86
|
-
def self.register(name, args = {}, &block)
|
87
|
-
SparkleFormation.part_data[:registry].push(
|
88
|
-
::Smash.new(
|
89
|
-
:name => name,
|
90
|
-
:block => block,
|
91
|
-
:args => ::Smash[
|
92
|
-
args.map(&:to_a)
|
93
|
-
],
|
94
|
-
:type => :registry,
|
95
|
-
)
|
96
|
-
).last
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# @!visibility private
|
102
|
-
SfnRegistry = SparkleFormation::Registry
|
103
|
-
|
104
|
-
# NOTE: Enable access to top level constants but do not
|
105
|
-
# include deprecated constants to prevent warning outputs
|
106
|
-
deprecated_constants = [
|
107
|
-
:Data,
|
108
|
-
:Config,
|
109
|
-
:TimeoutError,
|
110
|
-
:Fixnum,
|
111
|
-
:Bignum,
|
112
|
-
:NIL,
|
113
|
-
:TRUE,
|
114
|
-
:FALSE,
|
115
|
-
]
|
116
|
-
::Object.constants.each do |const|
|
117
|
-
unless (self.const_defined?(const)) # rubocop:disable Style/RedundantSelf
|
118
|
-
next if deprecated_constants.include?(const)
|
119
|
-
self.const_set(const, ::Object.const_get(const)) # rubocop:disable Style/RedundantSelf
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
# @!visibility private
|
124
|
-
def part_data(arg)
|
125
|
-
SparkleFormation.part_data(arg)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
7
|
class << self
|
130
8
|
@@_pack_registry = Smash.new
|
131
9
|
|
@@ -184,7 +62,134 @@ class SparkleFormation
|
|
184
62
|
# Wrapper for evaluating sfn files to store within sparkle
|
185
63
|
# container
|
186
64
|
def eval_wrapper
|
187
|
-
|
65
|
+
# Evaluation context wrapper for loading SparkleFormation files
|
66
|
+
Class.new(BasicObject).new.instance_exec do
|
67
|
+
wrapper = ::Class.new(BasicObject)
|
68
|
+
wrapper.class_eval '
|
69
|
+
class SparkleFormation
|
70
|
+
attr_accessor :sparkle_path
|
71
|
+
|
72
|
+
class << self
|
73
|
+
def insert(*args, &block)
|
74
|
+
::SparkleFormation.insert(*args, &block)
|
75
|
+
end
|
76
|
+
|
77
|
+
def part_data(data = nil)
|
78
|
+
if data
|
79
|
+
@data = data
|
80
|
+
else
|
81
|
+
@data
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def dynamic(name, args = {}, &block)
|
86
|
+
part_data[:dynamic].push(
|
87
|
+
::Smash.new(
|
88
|
+
:name => name,
|
89
|
+
:block => block,
|
90
|
+
:args => ::Smash[
|
91
|
+
args.map(&:to_a)
|
92
|
+
],
|
93
|
+
:type => :dynamic,
|
94
|
+
)
|
95
|
+
).last
|
96
|
+
end
|
97
|
+
|
98
|
+
def build(&block)
|
99
|
+
part_data[:component].push(
|
100
|
+
::Smash.new(
|
101
|
+
:block => block,
|
102
|
+
:type => :component,
|
103
|
+
)
|
104
|
+
).last
|
105
|
+
end
|
106
|
+
|
107
|
+
def component(name, args = {}, &block)
|
108
|
+
part_data[:component].push(
|
109
|
+
::Smash.new(
|
110
|
+
:name => name,
|
111
|
+
:block => block,
|
112
|
+
:args => ::Smash[
|
113
|
+
args.map(&:to_a)
|
114
|
+
],
|
115
|
+
:type => :component,
|
116
|
+
)
|
117
|
+
).last
|
118
|
+
end
|
119
|
+
|
120
|
+
def dynamic_info(*args)
|
121
|
+
::Smash.new(:metadata => {}, :args => {})
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def initialize(*args)
|
126
|
+
opts = args.detect { |a| a.is_a?(Hash) } || {}
|
127
|
+
SparkleFormation.part_data[:template].push(
|
128
|
+
::Smash.new(
|
129
|
+
:name => args.first,
|
130
|
+
:args => opts,
|
131
|
+
)
|
132
|
+
)
|
133
|
+
raise ::TypeError
|
134
|
+
end
|
135
|
+
|
136
|
+
class Registry
|
137
|
+
def self.register(name, args = {}, &block)
|
138
|
+
SparkleFormation.part_data[:registry].push(
|
139
|
+
::Smash.new(
|
140
|
+
:name => name,
|
141
|
+
:block => block,
|
142
|
+
:args => ::Smash[
|
143
|
+
args.map(&:to_a)
|
144
|
+
],
|
145
|
+
:type => :registry,
|
146
|
+
)
|
147
|
+
).last
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
SfnRegistry = SparkleFormation::Registry
|
153
|
+
|
154
|
+
# @!visibility private
|
155
|
+
def require(*args)
|
156
|
+
::Kernel.require(*args)
|
157
|
+
end
|
158
|
+
|
159
|
+
# NOTE: Enable access to top level constants but do not
|
160
|
+
# include deprecated constants to prevent warning outputs
|
161
|
+
deprecated_constants = [
|
162
|
+
:Data,
|
163
|
+
:Config,
|
164
|
+
:TimeoutError,
|
165
|
+
:Fixnum,
|
166
|
+
:Bignum,
|
167
|
+
:NIL,
|
168
|
+
:TRUE,
|
169
|
+
:FALSE,
|
170
|
+
]
|
171
|
+
::Object.constants.each do |const|
|
172
|
+
unless self.const_defined?(const) # rubocop:disable Style/RedundantSelf
|
173
|
+
next if deprecated_constants.include?(const)
|
174
|
+
self.const_set(const, ::Object.const_get(const)) # rubocop:disable Style/RedundantSelf
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# @!visibility private
|
179
|
+
def part_data(arg)
|
180
|
+
SparkleFormation.part_data(arg)
|
181
|
+
end
|
182
|
+
|
183
|
+
def __sparkle_formation_id
|
184
|
+
SparkleFormation.object_id
|
185
|
+
end
|
186
|
+
|
187
|
+
def __sfn_registry_id
|
188
|
+
SfnRegistry.object_id
|
189
|
+
end
|
190
|
+
'
|
191
|
+
wrapper.new
|
192
|
+
end
|
188
193
|
end
|
189
194
|
|
190
195
|
include Bogo::Memoization
|
@@ -243,7 +248,7 @@ class SparkleFormation
|
|
243
248
|
:template => [],
|
244
249
|
)
|
245
250
|
@provider = Bogo::Utility.snake(args.fetch(:provider, 'aws').to_s).to_sym
|
246
|
-
@wrapper = eval_wrapper
|
251
|
+
@wrapper = eval_wrapper
|
247
252
|
wrapper.part_data(raw_data)
|
248
253
|
load_parts! unless @root == :none
|
249
254
|
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.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attribute_struct
|