backup_client 0.1.3 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9751b1230fda523c9219bac0be687234d1c2a1a8130e365730a89292839b925c
4
- data.tar.gz: e4a0397dcff58ecfa17a49c69439df02817bd9807b0c0ef998510e0f9ba57dc2
3
+ metadata.gz: 868d02ea96a38e6811774dfd6be576200c3f94891a3f88d441cc073038f7982c
4
+ data.tar.gz: 7b4d6ff56d5b95b52a04f0a24efce214c5c95dcfed9e819b21c93b0279afae97
5
5
  SHA512:
6
- metadata.gz: 74213ec236a3bef9a34a5c8cd8cfc0f469acbe60c1acc2ce9dd1f756ea09d23bc6196ac2c144e73b6af1842c6679d320f179fa5339aeacb57ef841a56a80af40
7
- data.tar.gz: a96dd3ba2d6e8a8c99ece3cf459586f739f99674ed5d1f77a9b831cc9280f6aa3d0838150d243d3726e3cd61e45b442edfc30589af440efb9a044145c58fe19c
6
+ metadata.gz: e660779e941599ac07960541a5e4fab2346b5ac3b6f0b33831ab5d99a638ca6889a7374853cd85cdada5fd23a9c0683968fa3b611a660b59cace0a7acd6534c6
7
+ data.tar.gz: 74fe62dfb3237ecce2523bf52909c7c30625ee555cc360fa54997847a6f772d0fa18db6ebd12ac1b24b8a64d3deccace69e645b8cc1c2bfe313105ba354fd19d
@@ -22,6 +22,8 @@ module BackupClient
22
22
  end
23
23
 
24
24
  log "Uploaded file #{local_file_path} → #{remote_file_path}"
25
+ rescue StandardError => error
26
+ log "Unexpected file upload error. #{local_file_path} → #{remote_file_path}, error: #{error.to_s}"
25
27
  end
26
28
 
27
29
  private
@@ -31,7 +31,7 @@ module BackupClient
31
31
 
32
32
  def ftp_processing
33
33
  source_paths.each do |path|
34
- folder = to_unix_path(path)
34
+ folder = path# to_unix_path(path)
35
35
 
36
36
  if File.file?(folder)
37
37
  upload_file_ftp(folder, destination_path)
@@ -43,14 +43,6 @@ module BackupClient
43
43
  end
44
44
  end
45
45
 
46
- def to_unix_path(path)
47
- if Regexp.new('^[A-Za-z]:\\\\') =~ path
48
- path.sub(/^[A-Za-z]:\\/, '/').gsub('\\', '/')
49
- else
50
- path
51
- end
52
- end
53
-
54
46
  def ftp_client
55
47
  @ftp_client ||=
56
48
  begin
@@ -3,6 +3,14 @@
3
3
  module BackupClient
4
4
  module Helpers
5
5
  module FtpHelper
6
+ def to_unix_path(path)
7
+ if Regexp.new('^[A-Za-z]:\\\\') =~ path
8
+ path.sub(/^[A-Za-z]:\\/, '/').gsub('\\', '/')
9
+ else
10
+ path
11
+ end
12
+ end
13
+
6
14
  def ftp_chdir(ftp_client, path)
7
15
  return if ftp_client.pwd == path
8
16
 
@@ -32,9 +40,9 @@ module BackupClient
32
40
 
33
41
  def ftp_mkdir_p(path)
34
42
  root_chdir(ftp_client)
35
- return if ftp_mkdir(path)
43
+ return if ftp_mkdir(to_unix_path(path))
36
44
 
37
- parts = path.split("/").reject(&:empty?)
45
+ parts = to_unix_path(path).split("/").reject(&:empty?)
38
46
  parts.each do |part|
39
47
  begin
40
48
  ftp_client.mkdir(part)
data/lib/backup_client.rb CHANGED
@@ -17,7 +17,7 @@ Dir.glob("components/**/*.rb").sort.each do |file|
17
17
  end
18
18
 
19
19
  module BackupClient
20
- VERSION = "0.1.3"
20
+ VERSION = "0.1.5"
21
21
 
22
22
  class Processor
23
23
  include ::BackupClient::Helpers::LogHelper
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-21 00:00:00.000000000 Z
11
+ date: 2025-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ftp