eco-helpers 2.7.10 → 2.7.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -8
- data/lib/eco/api/common/session/sftp.rb +5 -1
- data/lib/eco/api/usecases/graphql/utils/sftp.rb +14 -14
- 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: e3c92964baf09be5673e74f4a1762d03ce0efe159e7d6a2bc6da3839ac99f4f0
|
4
|
+
data.tar.gz: 26525ccfbdbb06f348d293a50a02de644f7a0a32f3f5285537c75d8d14fe3601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7620a74731fbfc7d17d1b21f7930df4753003a919fa9d79550083002f454c57716cceab6afec8738d9a37e5b2cd749cd42541f0913286d66c1387b7b88b27c5e
|
7
|
+
data.tar.gz: 1db57df2c9a4b8e5863580524d34e655c92d5e4ddd15e6a8cacbe8b9e9e8af73ae2d3fb05fd1f4dc6de119c2ee5e20b3971b234c073910153aec5137807ef37b
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [2.7.12] - 2024-05-xx
|
5
4
|
|
6
|
-
|
7
|
-
### Changed
|
8
|
-
### Fixed
|
5
|
+
## [2.7.11] - 2024-05-xx
|
9
6
|
|
10
|
-
|
7
|
+
### Added
|
8
|
+
### Changed\
|
9
|
+
- `Eco::API::Common::Session::SFTP#download`
|
10
|
+
- It now returns the local filename(s) of the downloaded files.
|
11
|
+
- `Eco::API::UseCases::GraphQL::Utils#sftp_download_files`
|
12
|
+
- It now returns the local filename(s) of the downloaded files.
|
11
13
|
|
12
|
-
###
|
13
|
-
- Upgrade SFTP access
|
14
|
+
### Fixed
|
14
15
|
|
15
|
-
## [2.7.10] - 2024-05-
|
16
|
+
## [2.7.10] - 2024-05-20
|
16
17
|
|
17
18
|
### Changed
|
18
19
|
- Temporarily silent warnings on tracking id changes (apparently the tracking locations tree is not up to date with latest version and gives false warnings)
|
20
|
+
- Upgrade SFTP access
|
19
21
|
|
20
22
|
### Fixed
|
21
23
|
- Remove enviro from tagtree download
|
@@ -74,15 +74,19 @@ module Eco
|
|
74
74
|
# @see Net::SFTP::Operations::Download
|
75
75
|
# @param files [String, Array<String>] full path to remote file(s) to be downloaded
|
76
76
|
# @param local_folder [String] local destination folder (`"."` if not specified)
|
77
|
-
|
77
|
+
# @return [Array<String>] list of created files
|
78
|
+
def download(files, local_folder: nil, &block)
|
78
79
|
puts "Creating local files:"
|
80
|
+
created_files = []
|
79
81
|
[files].flatten.compact.map do |fullname|
|
80
82
|
basename = windows_basename(fullname)
|
81
83
|
dest_fullname = File.join(local_folder || ".", basename)
|
82
84
|
puts " • #{dest_fullname}"
|
85
|
+
created_files << dest_fullname
|
83
86
|
sftp_session.download(fullname, dest_fullname)
|
84
87
|
end.each(&:wait)
|
85
88
|
# run SSH event loop while dw.active?
|
89
|
+
created_files.tap { created_files.each(&block) }
|
86
90
|
end
|
87
91
|
|
88
92
|
# Upload a file to the specific `remote_folder`
|
@@ -19,20 +19,20 @@ module Eco::API::UseCases::GraphQL::Utils
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def sftp_download_files(subfolder: remote_subfolder, pattern: nil, local_folder: self.local_folder)
|
23
|
-
with_remote_files(subfolder: subfolder, pattern: pattern)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
def sftp_download_files(subfolder: remote_subfolder, pattern: nil, local_folder: self.local_folder, &block)
|
23
|
+
remote_files = with_remote_files(subfolder: subfolder, pattern: pattern)
|
24
|
+
return [] if remote_files.empty?
|
25
|
+
|
26
|
+
file_names = remote_files.map {|file| to_remote_path(file.name, subfolder: subfolder)}
|
27
|
+
|
28
|
+
log(:info) {
|
29
|
+
msg = "Getting the following files into the local folder '#{local_folder}':\n"
|
30
|
+
msg << " • "
|
31
|
+
msg << file_names.join("\n • ")
|
32
|
+
msg
|
33
|
+
}
|
34
|
+
|
35
|
+
sftp.download(file_names, local_folder: local_folder, &block)
|
36
36
|
end
|
37
37
|
|
38
38
|
def sftp_move_file(source, dest)
|
data/lib/eco/version.rb
CHANGED