eco-helpers 3.0.8 → 3.0.10

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: c5f99b7ad6dad2fcd262a6269bbe2c7a2acae695b077712ce745c9f0746e2580
4
- data.tar.gz: de2217f416b703f1cc0ae06f6c42bddbebedef906013b128b5efcdc552df40af
3
+ metadata.gz: 618c3849705c9b3977d73927a2ffc26ca15dd8772868b35f554524912e31ba93
4
+ data.tar.gz: c11a69b25ca5b2c12ac4cc9efc7b14d276d58c3baabe8be6027f87b59770c47b
5
5
  SHA512:
6
- metadata.gz: 6149a32bf28606ac1051a127deabefd66fbab577700035f36ba01b9268438b1223423a30e399c1efaed92858586722a0dfa6d7d1a180a4ff0870c894ac730fde
7
- data.tar.gz: 1799bbf948a1725f99b567b0934c29eb53f3361db5c22c660e616e876cc857c15c85330db3d2e60df4a6d5f1c0c9697722e1ded6b114897cbe8b5a257fd06511
6
+ metadata.gz: 7e5a67b202d231c987f2909639f1a3f40e43a04c86ea66ec3d93d4a22bca08ea1f30b481382e44ef24c6b3d48c2e5a7ae7a51d05df9919ac896163a7813176f6
7
+ data.tar.gz: f69d8e030008308840daf7ddb00c67df6d63e1029d4cd4de3d435f8c05467c1eb0f9b3ddb2a7fbf44a0f70faa23006d4ac7a00e166743d133f9e8cbe000fb7f3
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.0.9] - 2024-08-xx
5
+ ## [3.0.11] - 2024-09-xx
6
6
 
7
7
  ### Added
8
8
 
@@ -10,6 +10,22 @@ All notable changes to this project will be documented in this file.
10
10
 
11
11
  ### Fixed
12
12
 
13
+ ## [3.0.10] - 2024-09-05
14
+
15
+ ### Added
16
+
17
+ ### Changed
18
+
19
+ ### Fixed
20
+
21
+ - wrong sftp error constant path
22
+
23
+ ## [3.0.9] - 2024-09-05
24
+
25
+ ### Fixed
26
+
27
+ - `Eco::API::Common::Session::SFTP#move` fixed error handling.
28
+
13
29
  ## [3.0.8] - 2024-08-30
14
30
 
15
31
  ### Added
@@ -63,11 +63,30 @@ module Eco
63
63
  # @see Net::SFTP::Session#rename
64
64
  def move(fullname_source, fullname_dest, flags = 0x0001, override: true, &callback)
65
65
  sftp_session.rename!(fullname_source, fullname_dest, flags, &callback)
66
- rescue Net::SFTP::StatusException => _err
67
- raise unless override
68
-
69
- sftp_session.remove(fullname_dest)
70
- sftp_session.rename!(fullname_source, fullname_dest, flags, &callback)
66
+ rescue Net::SFTP::StatusException => err
67
+ case err.code
68
+ when Net::SFTP::Constants::StatusCodes::FX_FILE_ALREADY_EXISTS
69
+ log(:waning) {
70
+ msg = "Remote file '#{fullname_dest}' already exists."
71
+ msg << "Overriding..." if override
72
+ }
73
+
74
+ if override
75
+ sftp_session.remove(fullname_dest)
76
+ # sftp_session.rename!(fullname_source, fullname_dest, flags, &callback)
77
+ move(fullname_source, fullname_dest, flags, override: false, &callback)
78
+ end
79
+ when Net::SFTP::Constants::StatusCodes::FX_PERMISSION_DENIED, Net::SFTP::Constants::StatusCodes::FX_WRITE_PROTECT
80
+ log(:error) {
81
+ "Not allowed to rename '#{fullname_source}' to '#{fullname_dest}'"
82
+ }
83
+ when Net::SFTP::Constants::StatusCodes::FX_NO_SUCH_FILE
84
+ log(:error) { "Remote file '#{fullname_source}' does not exist"}
85
+ when Net::SFTP::Constants::StatusCodes::FX_NO_SUCH_PATH
86
+ log(:error) { err }
87
+ else
88
+ raise
89
+ end
71
90
  end
72
91
 
73
92
  # Downloads the files specified to a local folder
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = '3.0.8'.freeze
2
+ VERSION = '3.0.10'.freeze
3
3
  end
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.0.8
4
+ version: 3.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake