eco-helpers 2.4.7 → 2.4.8
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 +6 -1
- data/lib/eco/api/organization/tag_tree.rb +18 -3
- 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: facf3e640f8af36beba49a9da6eb7c72cb70b4a07ef93602ee70898cce31c356
|
4
|
+
data.tar.gz: 304bb16fdefd0db6ad63b524a654aed990375a24630565d59cfb6fa4470e94da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d4b1882f5c042ceeeee46bfb6e1604204092a108409c882df2f82e125259cd11551ce90e48c40cf5c7cdf50286eda42b624c9cd24d9e1ea13d4a8bb3203d9b2
|
7
|
+
data.tar.gz: 91061e3b0d8caafc59fbd77ca726cf84c83d459eb1bad420932ad3482842d57acd1a38a35373a82078638b6c7e41e570a6c7f2adb84a319a38c61509555d2bc9
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,17 @@
|
|
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.9] - 2023-04-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
### Changed
|
8
8
|
### Fixed
|
9
9
|
|
10
|
+
## [2.4.8] - 2023-04-03
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- `Eco::API::Organization::TagTree#ancestors` returns the ancestor nodes.
|
14
|
+
|
10
15
|
## [2.4.7] - 2023-04-03
|
11
16
|
|
12
17
|
### Added
|
@@ -84,7 +84,7 @@ module Eco
|
|
84
84
|
|
85
85
|
# All actual nodes of this tree
|
86
86
|
# @note order is that of the parent to child relationships
|
87
|
-
# @return [Array
|
87
|
+
# @return [Array<TagTree>]
|
88
88
|
def all_nodes(&block)
|
89
89
|
[].tap do |out_nodes|
|
90
90
|
unless top?
|
@@ -97,6 +97,18 @@ module Eco
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
# All the acenstor nodes of the current node
|
101
|
+
# @note it does not include the current node
|
102
|
+
# @return [Array<TagTree>] ancestors sorted from top to bottom.
|
103
|
+
def ancestors
|
104
|
+
[].tap do |ans|
|
105
|
+
unless parent.top?
|
106
|
+
ans << parent
|
107
|
+
ans.concat(parent.ancestors)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
100
112
|
# @return [Array] with the differences
|
101
113
|
def diff(tagtree, differences: {}, level: 0, **options)
|
102
114
|
require 'hashdiff'
|
@@ -114,8 +126,11 @@ module Eco
|
|
114
126
|
nodes_json
|
115
127
|
else
|
116
128
|
{
|
117
|
-
"id"
|
118
|
-
"
|
129
|
+
"id" => tag,
|
130
|
+
"archived" => archived,
|
131
|
+
"archived_token" => archived_token,
|
132
|
+
"weight" => weight,
|
133
|
+
"nodes" => nodes_json
|
119
134
|
}
|
120
135
|
end
|
121
136
|
end
|
data/lib/eco/version.rb
CHANGED