eco-helpers 2.4.3 → 2.4.4
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 +16 -1
- data/lib/eco/api/organization/tag_tree.rb +28 -3
- data/lib/eco/api/session.rb +1 -1
- data/lib/eco/api/usecases/ooze_samples/register_update_case.rb +2 -2
- data/lib/eco/version.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: 3c2d5e728987bee135ac2297b0a84858dfb14eab79b3decebc59ced1a74ccc4a
|
4
|
+
data.tar.gz: b906c449d80dbc1440c1b7e7d91565bad53409167cae3c07b0788870f842cf5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a9781490f01e1d9ffafdec19179d492d760c9dca676e2e6f2771b61a8f422d5c9f481bb03c71563c91df97b72f89cee0e8aa664be42dcf1dd5d99576177add
|
7
|
+
data.tar.gz: 44eed6e779b8ffdfdc1bea5913090713cc15dba649b7c2eddc9f333a8be67f92afa1ec6e1d06b0c31bcf2b29d062b92cac26c7c53b07404e50d089ae56698202
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,27 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [2.4.
|
4
|
+
## [2.4.5] - 2023-03-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
### Changed
|
8
8
|
### Fixed
|
9
9
|
|
10
|
+
## [2.4.4] - 2023-03-29
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- `Eco::API:Organization::TagTree`
|
14
|
+
- Added **methods** `#each` and `#all_nodes` allow to loop through all nodes
|
15
|
+
- Added `parent` to refer to the parent node.
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
- `Eco::API:Organization::TagTree` made **Enumerable**
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
- `Eco:API::Session#live_tree` pass `enviro`
|
22
|
+
- `Eco::API::UseCases::OozeSamples::RegisterUpdateCase`
|
23
|
+
- Fix typo on error message.
|
24
|
+
|
10
25
|
## [2.4.3] - 2023-03-23
|
11
26
|
|
12
27
|
### Fixed
|
@@ -7,10 +7,13 @@ module Eco
|
|
7
7
|
alias_method :tag, :id
|
8
8
|
attr_accessor :name
|
9
9
|
|
10
|
+
attr_reader :parent
|
10
11
|
attr_reader :nodes, :children_count
|
11
12
|
attr_reader :depth, :path
|
12
13
|
attr_reader :enviro
|
13
14
|
|
15
|
+
include Enumerable
|
16
|
+
|
14
17
|
# @example Node format:
|
15
18
|
# {"tag": "NODE NAME", "nodes": subtree}
|
16
19
|
# @example Tree/subtree format:
|
@@ -21,8 +24,9 @@ module Eco
|
|
21
24
|
# ]}]
|
22
25
|
# tree = TagTree.new(tree.to_json)
|
23
26
|
# @param tagtree [String] representation of the tagtree in json.
|
24
|
-
def initialize(tagtree = [], name: nil, id: nil, depth: -1, path: [], enviro: nil)
|
25
|
-
@depth
|
27
|
+
def initialize(tagtree = [], name: nil, id: nil, depth: -1, path: [], parent: nil, enviro: nil)
|
28
|
+
@depth = depth
|
29
|
+
@parent = parent
|
26
30
|
|
27
31
|
case tagtree
|
28
32
|
when String
|
@@ -48,7 +52,7 @@ module Eco
|
|
48
52
|
@path.push(@id) unless top?
|
49
53
|
|
50
54
|
@nodes = @row_nodes.map do |cnode|
|
51
|
-
TagTree.new(cnode, depth: depth + 1, path: @path.dup, enviro: @enviro)
|
55
|
+
TagTree.new(cnode, depth: depth + 1, path: @path.dup, parent: self, enviro: @enviro)
|
52
56
|
end
|
53
57
|
|
54
58
|
init_hashes
|
@@ -59,6 +63,27 @@ module Eco
|
|
59
63
|
self.class.new(as_json)
|
60
64
|
end
|
61
65
|
|
66
|
+
# Iterate through all the nodes of this tree
|
67
|
+
# @yield [node] do some stuff with one of the nodes of the tree
|
68
|
+
# @yieldparam node [Eco::API::Organization::TagTree] a node of the tree
|
69
|
+
# @return [Enumerable<Eco::API::Organization::TagTree>]
|
70
|
+
def each(&block)
|
71
|
+
return to_enum(:each) unless block
|
72
|
+
all_nodes.each(&block)
|
73
|
+
end
|
74
|
+
|
75
|
+
# All actual nodes of this tree
|
76
|
+
# @note order is that of the parent to child relationships
|
77
|
+
# @return [Array[]]
|
78
|
+
def all_nodes(&block)
|
79
|
+
[].tap do |all_nodes|
|
80
|
+
all_nodes.push(self) unless top?
|
81
|
+
nodes.each do |node|
|
82
|
+
all_nodes.concat(node.all_nodes)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
62
87
|
# @return [Array] with the differences
|
63
88
|
def diff(tagtree, differences: {}, level: 0, **options)
|
64
89
|
require 'hashdiff'
|
data/lib/eco/api/session.rb
CHANGED
@@ -109,7 +109,7 @@ class Eco::API::UseCases::OozeSamples::RegisterUpdateCase < Eco::API::UseCases::
|
|
109
109
|
if dirty?(pending)
|
110
110
|
msg = "Inconsistent search results. "
|
111
111
|
msg << "Launching update on '#{object_reference(pending)}' to be able to queue it back"
|
112
|
-
|
112
|
+
logger.warn msg
|
113
113
|
update_ooze(pending)
|
114
114
|
end
|
115
115
|
end
|
@@ -118,7 +118,7 @@ class Eco::API::UseCases::OozeSamples::RegisterUpdateCase < Eco::API::UseCases::
|
|
118
118
|
yield(ooz)
|
119
119
|
else
|
120
120
|
@non_retrieved_oozes += 1
|
121
|
-
|
121
|
+
logger.warn "Could not get page #{page_result.id}"
|
122
122
|
end
|
123
123
|
end
|
124
124
|
update_oozes
|
data/lib/eco/version.rb
CHANGED