bdsync 2.3.0 → 2.3.1

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: 6fa64e8243c110577ac96c4266d21f3d7f2f1a2035644d83e52fc6e61db86ac3
4
- data.tar.gz: bbd68644aa5817c438992b5e70ba0ab5622e3f8dc2cfa5c0ef3e9a0572d030fc
3
+ metadata.gz: 3865c38b86bcf0540b21e46442709b59af317a9980e57cdecf372bc589b2ba3c
4
+ data.tar.gz: 58896d6137ae9f0e2cd06f593a5fe49c88a236ff134cd21dad6a6ac80f3a8cf2
5
5
  SHA512:
6
- metadata.gz: db7bc9a4be128150de8920f014c12cbc3533fdafb1d978945b058e0c9816edc04bf0eabcbaa7f85d412275fcf4958ffc333f22a939955eb792c3514e7c9dbe7c
7
- data.tar.gz: f4550efd06ec82dc092345711e5310bf3b03f8c9271df6c31c43b6c060fc13f0f3608ab32f34c9ab63dcc29e6250959dedfe6afd105f0a98fda1b529f97cffa6
6
+ metadata.gz: 027aa2ca7b11b67e7bd03c0424edb041ac7a00fdaf48d71fa91929653fd1490f6d467b4b035d319ab6c5d491aaa79bb2972e810c46839846926fa60e5b970be1
7
+ data.tar.gz: cd94a0d04298dc29595637e7b034806d22eaf1c56f234db9a9339d29e77ce78d9be6adee23ed4ef76ae4a56f8b073327b1cfc06b4911ce0b52b88bc7c74db8d7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bdsync (2.3.0)
4
+ bdsync (2.3.1)
5
5
  colorize (~> 0.8)
6
6
  net-sftp (~> 2.1)
7
7
 
File without changes
@@ -101,9 +101,18 @@ module Bdsync
101
101
  end
102
102
 
103
103
  def get_remote_file_md5 remote_path
104
- puts "#{Utils.caller_info 1} sftp.session.exec! md5sum #{remote_path}".white
105
- res = @sftp.session.exec! "md5sum #{remote_path}"
106
- res.split[0]
104
+ puts "#{Utils.caller_info 1} get_remote_file_md5 #{remote_path}".white
105
+
106
+ tmpfile = Tempfile.new 'sftp.rb-get_remote_file_md5-'
107
+
108
+ begin
109
+ tmpfile.close
110
+
111
+ @sftp.download! remote_path, tmpfile.path
112
+ Utils.file_md5 tmpfile.path
113
+ ensure
114
+ tmpfile.unlink # deletes the temp file
115
+ end
107
116
  end
108
117
 
109
118
  # for test
@@ -113,7 +122,7 @@ module Bdsync
113
122
  begin
114
123
  tmpfile.write content
115
124
  tmpfile.flush
116
-
125
+
117
126
  @sftp.upload! tmpfile.path, remote_path
118
127
  ensure
119
128
  tmpfile.close
@@ -1,3 +1,3 @@
1
1
  module Bdsync
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bdsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xia Xiongjun