modular_tree 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/modular_tree/algorithms.rb +8 -3
- data/lib/modular_tree/pool.rb +1 -0
- data/lib/modular_tree/version.rb +1 -1
- data/lib/modular_tree.rb +0 -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: 7d23a4572f944f931e8aaa2c3cfd9ae8b1f6390dd0f544d323fa843c8a0af5bf
|
4
|
+
data.tar.gz: 82bba4b625cf35b0a0e3ae64ce9580c6cf210f8b4505e00809db10e21eaad465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c20a27dec745e60a543df2364c23503f2a07d4fbffe4a35f396a929b424b3211362dbffd5c7da5bd7e9672320e703d8eb65d12bb12265fe978f4a05f838bb6
|
7
|
+
data.tar.gz: 0702eae6a45e5c4cc3ca730f5bc55ac8afaba789fbdc4414979184531e90c079027cd0b2fc47521bf54a48c963f95a4927b0446447126b7f3de8cd31ca823585
|
@@ -10,15 +10,20 @@ module Tree
|
|
10
10
|
include BranchesProperty
|
11
11
|
|
12
12
|
# Bottom-up
|
13
|
-
def
|
13
|
+
def parents(*filter)
|
14
|
+
filter = Filter.new(*filter)
|
14
15
|
curr = self
|
15
16
|
a = []
|
16
|
-
|
17
|
+
while curr = curr.branch
|
18
|
+
select, continue = filter.match(curr.node)
|
19
|
+
a.push curr.node if select
|
20
|
+
break if !continue
|
21
|
+
end
|
17
22
|
a
|
18
23
|
end
|
19
24
|
|
20
25
|
# Top-down # TODO: rename #ancestors
|
21
|
-
def
|
26
|
+
def ancestors
|
22
27
|
curr = self
|
23
28
|
a = []
|
24
29
|
a.unshift curr.node while curr = curr.branch
|
data/lib/modular_tree/pool.rb
CHANGED
data/lib/modular_tree/version.rb
CHANGED
data/lib/modular_tree.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modular_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: constrain
|