rhoella 0.1.1 → 0.1.2
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/reference/ruby/rhoella.rb +25 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4268ebe7c3d7f85cd4d23ccc5df3229ded41799f8e09b0e0b9113186520cfb2
|
|
4
|
+
data.tar.gz: 232c9978bd4c082c80274ca1711cbfba525060e22f3d6eb779a8186cdfa56131
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae894840496f0c5f2c7e387b182332aed5c510d398d3b208e98346ffc55d045ae2d0439e341bfbb5eed6531e45b9cf16526b8a2565d15941bfddfe607cc8e01e
|
|
7
|
+
data.tar.gz: 0e31d8b619ef7412ec99d1b6a7d41cd1b0402b892ae4fa523e6ecd45fc1cea07972e44f7201868c0c559dd256637582ba5f32508fb570f699c537f6210e0e7ff
|
data/reference/ruby/rhoella.rb
CHANGED
|
@@ -215,6 +215,31 @@ module Rhoella
|
|
|
215
215
|
@pos = 0
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
+
# Static analysis: the message and term ids this pattern references
|
|
219
|
+
# (message ids bare, term ids with their leading dash, member
|
|
220
|
+
# attributes stripped), including selectors. Strict hosts walk this
|
|
221
|
+
# against their catalog to fail loudly on unknown references — the
|
|
222
|
+
# engine itself renders unknown references softly, per the upstream
|
|
223
|
+
# fallback fixtures.
|
|
224
|
+
def references
|
|
225
|
+
refs = []
|
|
226
|
+
walk_references = lambda do |elements|
|
|
227
|
+
elements.each do |element|
|
|
228
|
+
case element[0]
|
|
229
|
+
when :message_ref then refs << element[1]
|
|
230
|
+
when :message_attr, :term_attr then refs << element[1]
|
|
231
|
+
when :term_ref then refs << element[1]
|
|
232
|
+
when :select
|
|
233
|
+
walk_references.call([element[1]])
|
|
234
|
+
element[2].each { |(_, arm_elements)| walk_references.call(arm_elements) }
|
|
235
|
+
walk_references.call(element[3])
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
walk_references.call(parse_elements(stop: nil))
|
|
240
|
+
refs.uniq
|
|
241
|
+
end
|
|
242
|
+
|
|
218
243
|
def parse_elements(stop:)
|
|
219
244
|
elements = []
|
|
220
245
|
buffer = +""
|