backup_client 0.1.6 → 0.1.7

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: 60adb5a917ae815d6f2ae6c9e59b8d077b18aa346c7be3d0aad9953c18e53440
4
- data.tar.gz: fbdd5342683a9d55b717e361b7b9ad3b03b9286fff773a02f3ea8a8ff37fa3cf
3
+ metadata.gz: 3f1b2c30caf1cf07ea1bf17b7e1826df07c92adcd53d2de7e9ab9c70ce57b01d
4
+ data.tar.gz: c9370f3665bc720198baaef3fd724aa85edb83a521418a4e70bd4e0cee6a563d
5
5
  SHA512:
6
- metadata.gz: 48b25cda2ad9c3e9b167f944a1d9a4d79257e55836daf77690bf8534bc432adaf49926c7ee9ae21244da1cd425a9c55386f559b2ff43c0bfb2ffc12e188e2661
7
- data.tar.gz: 3933a18ca3b19a0feba261fb50ac1a391fbe997681fa11c4ef39da2d74f3f06bf4f539674bfacb66e4ced12a7d298f22ebbac8d642fcd5b56cbc642db0146bab
6
+ metadata.gz: 53199c83635218313a595e5704daec73802c427b45171123774c837b511129817f85415d8c9da1bf9c5f78cd9eebda05c12413ba438d2b649aa38b20acf216db
7
+ data.tar.gz: 975b99b5039e9f2516944d1631cb8c0e308a777fb73f2e7b1c9a3183b85b6c1c43cbb240371633529d92b1ae8878e315e0d1e9005ab3d188d607679891f78251
@@ -15,7 +15,7 @@ module BackupClient
15
15
  end
16
16
 
17
17
  def call
18
- remote_file_path = [remote_folder_path, local_file_path].join("/").gsub("//", "/")
18
+ remote_file_path = [remote_folder_path, to_unix_path(local_file_path)].join("/").gsub("//", "/")
19
19
 
20
20
  File.open(local_file_path, "rb") do |file|
21
21
  ftp_client.putbinaryfile(file, remote_file_path)
@@ -15,7 +15,7 @@ module BackupClient
15
15
  end
16
16
 
17
17
  def call
18
- current_destination_folder = destination_folder + local_path
18
+ current_destination_folder = destination_folder + to_unix_path(local_path)
19
19
  ftp_mkdir_p(current_destination_folder)
20
20
  Dir.glob("#{local_path.gsub('\\', '/')}/**/*", File::FNM_DOTMATCH).each do |path|
21
21
  basename = File.basename(path)
@@ -4,11 +4,7 @@ module BackupClient
4
4
  module Helpers
5
5
  module FtpHelper
6
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
7
+ path.split(':').last.gsub("\\", "/").gsub(/\/+/, '/')
12
8
  end
13
9
 
14
10
  def ftp_chdir(ftp_client, path)
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.6"
20
+ VERSION = "0.1.7"
21
21
 
22
22
  class Processor
23
23
  include ::BackupClient::Helpers::LogHelper
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex