eco-helpers 3.2.10 → 3.2.12
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 +22 -1
- data/lib/eco/api/usecases/default/locations/cli/tagtree_extract_cli.rb +5 -0
- data/lib/eco/api/usecases/default/locations/tagtree_extract_case.rb +28 -5
- data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/heading.rb +10 -2
- data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing.rb +0 -6
- data/lib/eco/api/usecases/lib/files/sftp.rb +1 -1
- data/lib/eco/cli_default/options.rb +1 -1
- data/lib/eco/version.rb +1 -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: 91691c5a914be5eebeff46f776d9c5b720e8e9672317051f36b5995beff3977c
|
|
4
|
+
data.tar.gz: 1742764775b28b99f136e451cc79c68359924f7722752ccdae043cf7c1b7f6a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c17e149406ae8ae64c94b623e10a6151d9f0fd4755e736281a89c098c3c6ff180d7f85560d62e63741f3166d283882352e50cf48841c22e4f2106a17e76f3f0
|
|
7
|
+
data.tar.gz: 25199fc81a46ff8897be9af805bb675a4ee3ca11b61439a91450639703583c1907e97513fd26e14375a30956166dcb2cb35161a56b920f221ff6d2efc69bcee4
|
data/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [3.2.
|
|
5
|
+
## [3.2.13] - 2026-01-xx
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
@@ -10,6 +10,27 @@ All notable changes to this project will be documented in this file.
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
## [3.2.12] - 2026-01-19
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **support** for native CSV RS-update headers
|
|
18
|
+
- **removed** case insensitiveness on header names
|
|
19
|
+
- `-tagtree-extract` cli option `-structure-id`
|
|
20
|
+
- To be able to target only one structure
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Wrong option name `-default-tag` renamed to `-exclude-default-tag`
|
|
27
|
+
|
|
28
|
+
## [3.2.11] - 2025-12-04
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- missing Files lib dependency
|
|
33
|
+
|
|
13
34
|
## [3.2.10] - 2025-12-01
|
|
14
35
|
|
|
15
36
|
### Added
|
|
@@ -26,6 +26,11 @@ class Eco::API::UseCases::Default::Locations::TagtreeExtract
|
|
|
26
26
|
options.deep_merge!(output: {indent: indent})
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
add_option('-structure-id', 'Target structure id') do |options|
|
|
30
|
+
id = SCR.get_arg('-structure-id', with_param: true)
|
|
31
|
+
options.deep_merge!(source: {structure_id: id})
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
add_option('-file-as-source', 'Use a file as locations input (rather than the live locations)') do |options|
|
|
30
35
|
file = SCR.get_file('-file-as-source', required: true, should_exist: true)
|
|
31
36
|
options.deep_merge!(source: {file: file})
|
|
@@ -21,7 +21,11 @@ class Eco::API::UseCases::Default::Locations::TagtreeExtract < Eco::API::UseCase
|
|
|
21
21
|
when :excel_tree, :excel_nodes
|
|
22
22
|
excel(output_filename) do |workbook|
|
|
23
23
|
tag_trees.each do |tree|
|
|
24
|
-
excel_sheet(
|
|
24
|
+
excel_sheet(
|
|
25
|
+
workbook,
|
|
26
|
+
compact_name(tree.name),
|
|
27
|
+
header: format == :excel_nodes
|
|
28
|
+
) do |sheet|
|
|
25
29
|
tree_extract(tree).each_with_index do |row, _idx|
|
|
26
30
|
sheet.append_row(row)
|
|
27
31
|
end
|
|
@@ -121,9 +125,18 @@ class Eco::API::UseCases::Default::Locations::TagtreeExtract < Eco::API::UseCase
|
|
|
121
125
|
end
|
|
122
126
|
|
|
123
127
|
def retrieve_live_trees
|
|
124
|
-
session.live_trees(
|
|
128
|
+
session.live_trees(
|
|
129
|
+
include_archived: include_archived?
|
|
130
|
+
).reject do |tree|
|
|
131
|
+
next false if tree.id == tagtree_id
|
|
132
|
+
next true if tagtree_id
|
|
133
|
+
|
|
125
134
|
tree.empty?.tap do |rejected|
|
|
126
|
-
|
|
135
|
+
next unless rejected
|
|
136
|
+
|
|
137
|
+
log(:warn) {
|
|
138
|
+
"Tree '#{tree.name}' does NOT have location nodes. Skipping..."
|
|
139
|
+
}
|
|
127
140
|
end
|
|
128
141
|
end
|
|
129
142
|
end
|
|
@@ -138,6 +151,10 @@ class Eco::API::UseCases::Default::Locations::TagtreeExtract < Eco::API::UseCase
|
|
|
138
151
|
options.dig(:input, :file, :encoding) || 'utf-8'
|
|
139
152
|
end
|
|
140
153
|
|
|
154
|
+
def tagtree_id
|
|
155
|
+
options.dig(:source, :structure_id)
|
|
156
|
+
end
|
|
157
|
+
|
|
141
158
|
def file_as_source?
|
|
142
159
|
return true unless file_as_source.nil?
|
|
143
160
|
|
|
@@ -163,11 +180,17 @@ class Eco::API::UseCases::Default::Locations::TagtreeExtract < Eco::API::UseCase
|
|
|
163
180
|
end
|
|
164
181
|
|
|
165
182
|
def output_filename(name = self.class::OUT_FILENAME)
|
|
166
|
-
File.join(
|
|
183
|
+
File.join(
|
|
184
|
+
output_folder,
|
|
185
|
+
"#{timestamp}_#{config.active_enviro}_#{name}.#{output_file_format}"
|
|
186
|
+
)
|
|
167
187
|
end
|
|
168
188
|
|
|
169
189
|
def output_folder
|
|
170
|
-
|
|
190
|
+
File.join(
|
|
191
|
+
config.active_enviro,
|
|
192
|
+
self.class::OUT_FOLDER
|
|
193
|
+
)
|
|
171
194
|
end
|
|
172
195
|
|
|
173
196
|
def timestamp(date = Time.now)
|
|
@@ -5,12 +5,20 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
|
|
|
5
5
|
module Heading
|
|
6
6
|
# Define the maps src -> dst heading name
|
|
7
7
|
# @example {'parent_id' => 'parentId' }
|
|
8
|
-
HEADER_MAPS = {
|
|
8
|
+
HEADER_MAPS = {
|
|
9
|
+
'Node Name' => 'name',
|
|
10
|
+
'Node ID' => 'id',
|
|
11
|
+
'Parent ID' => 'parent_id',
|
|
12
|
+
'Classification IDs' => 'classifications',
|
|
13
|
+
'classification_ids' => 'classifications'
|
|
14
|
+
}.freeze
|
|
9
15
|
|
|
10
16
|
private
|
|
11
17
|
|
|
12
18
|
def header_maps
|
|
13
|
-
|
|
19
|
+
HEADER_MAPS.merge(
|
|
20
|
+
self.class::HEADER_MAPS
|
|
21
|
+
)
|
|
14
22
|
end
|
|
15
23
|
end
|
|
16
24
|
end
|
|
@@ -22,12 +22,6 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
|
|
|
22
22
|
msg << "Given: #{csv.class}"
|
|
23
23
|
raise ArgumentError, msg unless csv.is_a?(Eco::CSV::Table)
|
|
24
24
|
|
|
25
|
-
csv = csv.transform_headers do |name|
|
|
26
|
-
name = name.to_s.strip.downcase
|
|
27
|
-
name = 'classifications' if name == 'classification_ids'
|
|
28
|
-
name
|
|
29
|
-
end
|
|
30
|
-
|
|
31
25
|
csv.each do |row|
|
|
32
26
|
row_transform&.call(row)
|
|
33
27
|
transform_classifications(row)
|
|
@@ -49,7 +49,7 @@ module Eco::API::UseCases::Lib::Files
|
|
|
49
49
|
|
|
50
50
|
file_names = remote_files.map {|file| to_remote_path(file.name, subfolder: subfolder)}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
FileUtils.mkdir_p(local_folder)
|
|
53
53
|
|
|
54
54
|
log(:info) {
|
|
55
55
|
msg = "Getting the following files into the local folder "
|
|
@@ -338,7 +338,7 @@ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
|
|
|
338
338
|
options.deep_merge!(exclude: {policy_groups: true})
|
|
339
339
|
end
|
|
340
340
|
|
|
341
|
-
options_set.add('-default-tag', 'default_tag is not set with the input data') do |options|
|
|
341
|
+
options_set.add('-exclude-default-tag', 'default_tag is not set with the input data') do |options|
|
|
342
342
|
options.deep_merge!(exclude: {default_tag: true})
|
|
343
343
|
end
|
|
344
344
|
options_set.add('-exclude-abilities', 'permissions_custom is not set with the input data') do |options|
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eco-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: byebug
|