fbe 0.48.6 → 0.48.7
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/lib/fbe/conclude.rb +13 -1
- data/lib/fbe.rb +1 -1
- 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: cc71748bcfb59be79127dfc1373ee3dfe84e14e9843583322d89f95bef91969f
|
|
4
|
+
data.tar.gz: 26450c3e7d5e30e7e745464ef6b478fe99dbef34484401d6ca6fffabeb1bc5f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 979762592673b5f9ea6136185c339a5be403e164d5f7d614fdd2d2bdec646e69f274325fc2991b5085bbc3e7017329a5e3be96925dc7d2d65efe64b0813428e7
|
|
7
|
+
data.tar.gz: d8103526278d4b6c6e1c84b34ef358d310b02add12c5ee001223568dd65626c122ba1440074dcc8a043922ff19fd8458747119c41cb699c0229b33bf780e0c59
|
data/lib/fbe/conclude.rb
CHANGED
|
@@ -231,6 +231,13 @@ class Fbe::Conclude
|
|
|
231
231
|
# calls the provided block for custom processing, and sets metadata
|
|
232
232
|
# on the new fact.
|
|
233
233
|
#
|
|
234
|
+
# A property that is absent on the previous fact is skipped (its "[]"
|
|
235
|
+
# accessor returns nil). Factbase's "(as new old)" rewrite is only visible
|
|
236
|
+
# through method access (prev.new), while "[]" returns the raw stored value
|
|
237
|
+
# (see #595); when such a rewrite is in effect the method accessor returns
|
|
238
|
+
# the rewritten value, so we honor it. All values are still copied for
|
|
239
|
+
# genuinely multi-valued properties (see #520).
|
|
240
|
+
#
|
|
234
241
|
# @param [Factbase::Fact] fact The fact to populate
|
|
235
242
|
# @param [Factbase::Fact] prev The previous fact to copy from
|
|
236
243
|
# @yield [Factbase::Fact, Factbase::Fact] New fact and the previous fact
|
|
@@ -248,7 +255,12 @@ class Fbe::Conclude
|
|
|
248
255
|
# end
|
|
249
256
|
def fill(fact, prev)
|
|
250
257
|
@follows.each do |follow|
|
|
251
|
-
|
|
258
|
+
key = follow.to_s
|
|
259
|
+
values = prev[key]
|
|
260
|
+
next if values.nil?
|
|
261
|
+
rewritten = prev.public_send(follow)
|
|
262
|
+
values = [rewritten] unless values.first == rewritten
|
|
263
|
+
values.each do |v|
|
|
252
264
|
fact.public_send(:"#{follow}=", v)
|
|
253
265
|
end
|
|
254
266
|
end
|
data/lib/fbe.rb
CHANGED