eco-helpers 2.0.54 → 2.0.55

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6713de6610b0242f2d476fa8f82144b60c218ccede60d025f8f0cfd1e6bbecb7
4
- data.tar.gz: d13d56411aa7b8a3210b604c95e37c71efba08fe22742bdbb9262681354a56cb
3
+ metadata.gz: a4e49d95179b6066cd2729e64c1db009ed77de653c45a73eaebeab2387ae3bde
4
+ data.tar.gz: 746f3e6e1f8e17be778ec1c902a71810fa46c6439ea886449f2cf5dc7223d2b4
5
5
  SHA512:
6
- metadata.gz: 97b1fb26b7fd5c0f973ce97629138590c2c8f64a6bb2005ff82b95e1c5b353907f75702ebe4d3901a1ba5adb593e6b009b79bc03a87341d4dfce6db26229d36d
7
- data.tar.gz: e57f689af48070b215ca40f7dfbe5786f6fdf6a1d0013f795883213d02d3b9f0d97e0a26d548239b249c879f72c935e39f3ef684d65947a771da07c47f7fb427
6
+ metadata.gz: 88b70189433c7d4c71ea6b549e0eedbadafe9172bd8ea206d83e09f5bade447707f503e92b28f315e720e75743876f8aac480daf0ef5527d4525d17603e00bb2
7
+ data.tar.gz: d1d513c1c032101ab2aa9af5b1b41a542e99c0cb8312473c0b188698e855cdae965decda09134f01ec57123f2b518438dfe60c3a82265c2d93fdef51495ed0b3
data/CHANGELOG.md CHANGED
@@ -1,13 +1,19 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [2.0.55] - 2022-04-xx
5
+
6
+ ### Added
7
+ ### Changed
8
+ - `Eco::API::UseCases::DefaultCases::Samples::Sftp` should move the basename to Windows compatible chars.
9
+
10
+ ### Fixed
11
+
4
12
  ## [2.0.54] - 2022-04-04
5
13
 
6
14
  ### Added
7
15
  - `Eco::API::UseCases::DefaultCases::Samples::Sftp` should tell where the files went in the local.
8
16
 
9
- ### Changed
10
- ### Fixed
11
17
 
12
18
  ## [2.0.53] - 2022-04-04
13
19
 
@@ -65,8 +65,11 @@ module Eco
65
65
  # @param files [String, Array<String>] full path to remote file(s) to be downloaded
66
66
  # @param local_folder [String] local destination folder (`"."` if not specified)
67
67
  def download(files, local_folder: nil)
68
+ puts "Creating local files:"
68
69
  [files].flatten.compact.map do |fullname|
69
- dest_fullname = File.join(local_folder || ".", File.basename(fullname))
70
+ basename = windows_basename(fullname)
71
+ dest_fullname = File.join(local_folder || ".", basename)
72
+ puts " • #{dest_fullname}"
70
73
  sftp_session.download(fullname, dest_fullname)
71
74
  end.each do |dw|
72
75
  # run SSH event loop while dw.active?
@@ -76,6 +79,12 @@ module Eco
76
79
 
77
80
  private
78
81
 
82
+ def windows_basename(remote_fullname)
83
+ parts = remote_fullname.split(/[\\\/]/).map {|node| node.gsub(/[<>:\\\/\|?*]/, '_')}
84
+ local_fullname = File.join(*parts)
85
+ File.basename(local_fullname)
86
+ end
87
+
79
88
  def logger
80
89
  @enviro&.logger || ::Logger.new(IO::NULL)
81
90
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.0.54"
2
+ VERSION = "2.0.55"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.54
4
+ version: 2.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura