cloudsync 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ begin
15
15
  gem.add_dependency "commander", "~> 4.0.3"
16
16
  gem.add_dependency "net-ssh", "~> 2.0.19"
17
17
  gem.add_dependency "net-sftp", "~> 2.0.4"
18
-
18
+ gem.add_dependency "escape", "~> 0.0.4"
19
19
 
20
20
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
21
21
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
data/cloudsync.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudsync}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cory Forsyth"]
12
- s.date = %q{2010-10-12}
12
+ s.date = %q{2010-10-13}
13
13
  s.default_executable = %q{cloudsync}
14
14
  s.description = %q{Sync files between various clouds or sftp servers. Available backends are S3, CloudFiles, and SFTP servers. Can sync, mirror, and prune.}
15
15
  s.email = %q{cory.forsyth@gmail.com}
@@ -57,12 +57,14 @@ Gem::Specification.new do |s|
57
57
  s.add_runtime_dependency(%q<commander>, ["~> 4.0.3"])
58
58
  s.add_runtime_dependency(%q<net-ssh>, ["~> 2.0.19"])
59
59
  s.add_runtime_dependency(%q<net-sftp>, ["~> 2.0.4"])
60
+ s.add_runtime_dependency(%q<escape>, ["~> 0.0.4"])
60
61
  else
61
62
  s.add_dependency(%q<right_aws>, ["~> 2.0.0"])
62
63
  s.add_dependency(%q<cloudfiles>, ["~> 1.4.8"])
63
64
  s.add_dependency(%q<commander>, ["~> 4.0.3"])
64
65
  s.add_dependency(%q<net-ssh>, ["~> 2.0.19"])
65
66
  s.add_dependency(%q<net-sftp>, ["~> 2.0.4"])
67
+ s.add_dependency(%q<escape>, ["~> 0.0.4"])
66
68
  end
67
69
  else
68
70
  s.add_dependency(%q<right_aws>, ["~> 2.0.0"])
@@ -70,6 +72,7 @@ Gem::Specification.new do |s|
70
72
  s.add_dependency(%q<commander>, ["~> 4.0.3"])
71
73
  s.add_dependency(%q<net-ssh>, ["~> 2.0.19"])
72
74
  s.add_dependency(%q<net-sftp>, ["~> 2.0.4"])
75
+ s.add_dependency(%q<escape>, ["~> 0.0.4"])
73
76
  end
74
77
  end
75
78
 
@@ -1,5 +1,6 @@
1
1
  require 'net/ssh'
2
2
  require 'net/sftp'
3
+ require 'escape'
3
4
 
4
5
  module Cloudsync::Backend
5
6
  class Sftp < Base
@@ -78,7 +79,7 @@ module Cloudsync::Backend
78
79
  attrs = sftp.stat!(absolute_path(filepath))
79
80
  next unless attrs.file?
80
81
 
81
- e_tag = ssh.exec!("md5sum #{absolute_path(filepath)}").split(" ").first
82
+ e_tag = ssh.exec!(md5sum_cmd(filepath)).split(" ").first
82
83
  Cloudsync::File.new \
83
84
  :bucket => @bucket,
84
85
  :path => filepath,
@@ -98,6 +99,10 @@ module Cloudsync::Backend
98
99
 
99
100
  private
100
101
 
102
+ def md5sum_cmd(filepath)
103
+ Escape.shell_command(["md5sum","#{absolute_path(filepath)}"])
104
+ end
105
+
101
106
  # get_file_from_store
102
107
  def get_file_from_store(file)
103
108
  local_filepath = file.path.sub(/^#{@prefix}\/?/,"")
@@ -116,7 +121,7 @@ module Cloudsync::Backend
116
121
  end
117
122
  break unless attrs.file?
118
123
 
119
- e_tag = ssh.exec!("md5sum #{absolute_path(local_filepath)}").split(" ").first
124
+ e_tag = ssh.exec!(md5sum_cmd(filepath)).split(" ").first
120
125
  sftp_file = Cloudsync::File.new \
121
126
  :bucket => @bucket,
122
127
  :path => local_filepath,
@@ -108,7 +108,7 @@ module Cloudsync
108
108
  $LOGGER.info("Sync from #{from_backend} to #{to_backend} started at #{sync_start = Time.now}. Mode: #{mode}. Dry-run? #{!!dry_run?}")
109
109
 
110
110
  from_backend_files = from_backend.files_to_sync(to_backend.upload_prefix)
111
- to_backend_files = to_backend.files_to_sync(from_backend.upload_prefix)
111
+ to_backend_files = [] # to_backend.files_to_sync(from_backend.upload_prefix)
112
112
  total_files = from_backend_files.size
113
113
  last_decile_complete = 0
114
114
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudsync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cory Forsyth
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-12 00:00:00 -04:00
18
+ date: 2010-10-13 00:00:00 -04:00
19
19
  default_executable: cloudsync
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -98,6 +98,22 @@ dependencies:
98
98
  version: 2.0.4
99
99
  type: :runtime
100
100
  version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: escape
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ hash: 23
110
+ segments:
111
+ - 0
112
+ - 0
113
+ - 4
114
+ version: 0.0.4
115
+ type: :runtime
116
+ version_requirements: *id006
101
117
  description: Sync files between various clouds or sftp servers. Available backends are S3, CloudFiles, and SFTP servers. Can sync, mirror, and prune.
102
118
  email: cory.forsyth@gmail.com
103
119
  executables: