rbbt-util 5.5.61 → 5.5.62
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 +8 -8
- data/lib/rbbt/annotations.rb +1 -1
- data/lib/rbbt/annotations/annotated_array.rb +3 -3
- data/lib/rbbt/annotations/util.rb +2 -2
- data/lib/rbbt/association/index.rb +7 -4
- data/lib/rbbt/util/misc.rb +4 -0
- data/lib/rbbt/workflow/step.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDg5Y2QyYzUxN2JmMzM3Yjc1MzA4OWNhM2I4Yjk4MGU5YTI5NDU2Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWNhMGZhOTYxODNiMWM3NjZiMWRhNzUyMzQ3MDlhODFkNTc5M2EwZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTdiZTgyNTYyNTJhOGMwMjQ2MDliN2EwZjY0NzNkNjQxMzFhMzJkOWI0ZTBh
|
10
|
+
MzdmZDkyYjA0NzYzN2ZiYTY1MGUxMzk2YjNmNWExMGZkYWUzODQzYzA2MDM1
|
11
|
+
YWUwZGJiOWIxMzUzYWNmYmJjMWFhOTRiMTZjNWFkYzQwYTRhMTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2Y1MjZiYTAxZWY3MGJlMGVjNTcxNjcwZmVmZGFiMDY4OTllMzI1MWJkZTA2
|
14
|
+
MzE5YjA1ZjIxNzU1NDRiMjA2YTY0MWQ4ODU2YWMzYjMxM2IxOGJhMThmMjFk
|
15
|
+
MTU3NThhZmMzOThjNTZlMGNjOTEyODE0NGQ1ZGQyOGU5NTEyZjA=
|
data/lib/rbbt/annotations.rb
CHANGED
@@ -157,7 +157,7 @@ module Annotated
|
|
157
157
|
when Array
|
158
158
|
object.respond_to?(:clean_annotations) ?
|
159
159
|
object.clean_annotations :
|
160
|
-
object.
|
160
|
+
object.inject([]){|acc,e| acc << Annotated.purge(e); acc}
|
161
161
|
when Hash
|
162
162
|
object.each do |key, value|
|
163
163
|
object[key] = Annotated.purge value
|
@@ -22,7 +22,7 @@ module AnnotatedArray
|
|
22
22
|
|
23
23
|
value = annotate(value)
|
24
24
|
|
25
|
-
value.extend AnnotatedArray if Array === value
|
25
|
+
value.extend AnnotatedArray if Array === value and Annotated === value
|
26
26
|
|
27
27
|
if value.respond_to? :container
|
28
28
|
value.container = self
|
@@ -46,7 +46,7 @@ module AnnotatedArray
|
|
46
46
|
|
47
47
|
value = annotate(value)
|
48
48
|
|
49
|
-
value.extend AnnotatedArray if Array === value
|
49
|
+
value.extend AnnotatedArray if Array === value and Annotated === value
|
50
50
|
|
51
51
|
value.container = self
|
52
52
|
value.container_index = pos
|
@@ -97,7 +97,7 @@ module AnnotatedArray
|
|
97
97
|
end
|
98
98
|
|
99
99
|
annotate(res)
|
100
|
-
res.extend AnnotatedArray
|
100
|
+
res.extend AnnotatedArray
|
101
101
|
|
102
102
|
res
|
103
103
|
end
|
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
module Annotated
|
4
4
|
|
5
5
|
def self.flatten(array)
|
6
|
-
return array
|
6
|
+
return array unless Array === array and not array.empty?
|
7
7
|
array.extend AnnotatedArray if Annotated === array
|
8
8
|
return array.flatten if AnnotatedArray === array
|
9
9
|
begin
|
@@ -33,7 +33,7 @@ module Annotated
|
|
33
33
|
|
34
34
|
object.instance_variable_set(:@id, entity_id) if entity_id
|
35
35
|
|
36
|
-
object.extend AnnotatedArray if annotated_array
|
36
|
+
object.extend AnnotatedArray if annotated_array and Array === object
|
37
37
|
|
38
38
|
object
|
39
39
|
end
|
@@ -70,11 +70,15 @@ module Association
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def subset(source, target)
|
73
|
-
return [] if source.nil? or
|
73
|
+
return [] if source.nil? or target.nil?
|
74
74
|
|
75
|
-
|
75
|
+
if source == :all or source == "all"
|
76
|
+
matches = keys
|
77
|
+
else
|
78
|
+
matches = source.uniq.inject([]){|acc,e| acc.concat(match(e)) }
|
79
|
+
end
|
76
80
|
|
77
|
-
return matches if target
|
81
|
+
return matches if target == :all or target == "all"
|
78
82
|
|
79
83
|
target_matches = {}
|
80
84
|
|
@@ -90,7 +94,6 @@ module Association
|
|
90
94
|
|
91
95
|
def subset_entities(entities)
|
92
96
|
source, target = select_entities(entities)
|
93
|
-
raise "No source entities found" if source.nil?
|
94
97
|
subset source, target
|
95
98
|
end
|
96
99
|
end
|
data/lib/rbbt/util/misc.rb
CHANGED
data/lib/rbbt/workflow/step.rb
CHANGED