photocopier 1.0.0.pre2 → 1.0.0.pre3

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
  SHA1:
3
- metadata.gz: 34a9c7c59b8c7e92b5d4d4990ceed2338e940e43
4
- data.tar.gz: 131f054c780f62fbc7d10fb826f819c50c7163fa
3
+ metadata.gz: fa357cb2a64be14d6d7a5249d5af142357ec88e8
4
+ data.tar.gz: 8fe84e099a21f74776a74979205ca1ca06cb68f6
5
5
  SHA512:
6
- metadata.gz: 69c79a14deee1c2b237609b2aaac47f1fdab1bfc18aa36c418a7ebfb6481eb8837255b69aada5e56bd87b4ab8b7a8735e7360e178be7549af0858812de617157
7
- data.tar.gz: d90b64b2c6032ad21b627bb005ca721e05bdeccda5d18a7a691bfbc56f62326b85cae6e387b499abe19ca0adacd82738cb0e6d1d50a7ed45f32efab6e108d3fc
6
+ metadata.gz: 35b64e0dea575c624ed752ad6d118eada403565696dfb14f70538d6c8482c5e848e6285806f07f1214803db313a5a2f2ea9c250ecbda8174c4fb363163e90814
7
+ data.tar.gz: 8f5e6b6f69b551c328fd08adc54caac8a211446ab98662533aba513057463fd2145b484ec6e43d3e474e8ded6d5b420f481fbd3c33840c293fd7f5543546362c
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ lib/bundler/man
12
12
  pkg
13
13
  rdoc
14
14
  spec/reports
15
+ spec/examples.txt
15
16
  test/tmp
16
17
  test/version_tmp
17
18
  tmp
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.2
@@ -1,5 +1,4 @@
1
1
  module Photocopier
2
-
3
2
  class Adapter
4
3
  attr_accessor :logger
5
4
 
@@ -41,12 +41,15 @@ module Photocopier
41
41
  end
42
42
 
43
43
  def lftp(local, remote, reverse, exclude)
44
+ remote = Shellwords.escape(remote)
45
+ local = Shellwords.escape(local)
44
46
  command = [
45
47
  "set ftp:list-options -a",
48
+ "set cmd:fail-exit true",
46
49
  "open #{remote_ftp_url}",
47
- "mkdir -p #{Shellwords.escape(remote)}",
48
- "cd #{Shellwords.escape(remote)}",
49
- "lcd #{Shellwords.escape(local)}",
50
+ "find -d 1 #{remote} || mkdir -p #{remote}",
51
+ "lcd #{local}",
52
+ "cd #{remote}",
50
53
  lftp_mirror_arguments(reverse, exclude)
51
54
  ].join("; ")
52
55
 
@@ -66,10 +69,10 @@ module Photocopier
66
69
  end
67
70
 
68
71
  def lftp_mirror_arguments(reverse, exclude = [])
69
- mirror = "mirror --delete --use-cache --verbose --allow-chown --allow-suid --no-umask --parallel=2"
72
+ mirror = "mirror --delete --use-cache --verbose --allow-chown --allow-suid --no-umask --parallel=5"
70
73
  mirror << " --reverse" if reverse
71
74
  exclude.each do |glob|
72
- mirror << " --exclude-glob #{glob}"
75
+ mirror << " --exclude-glob #{glob}" # NOTE do not use Shellwords.escape here
73
76
  end
74
77
  mirror
75
78
  end
@@ -91,7 +91,7 @@ module Photocopier
91
91
 
92
92
  exclude.each do |glob|
93
93
  command << "--exclude"
94
- command << glob
94
+ command << Shellwords.escape(glob)
95
95
  end
96
96
 
97
97
  command << Shellwords.escape(source)
@@ -1,3 +1,3 @@
1
1
  module Photocopier
2
- VERSION = "1.0.0.pre2"
2
+ VERSION = "1.0.0.pre3"
3
3
  end
data/lib/photocopier.rb CHANGED
@@ -7,7 +7,8 @@ require 'net/ssh/gateway'
7
7
  require 'net/scp'
8
8
  require 'fileutils'
9
9
  require 'shellwords'
10
- require 'active_support/all'
10
+ require "active_support"
11
+ require "active_support/core_ext"
11
12
 
12
13
  require 'photocopier/adapter'
13
14
  require "photocopier/ssh"
data/photocopier.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_development_dependency "bundler", ">= 1.6.2"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
- spec.add_development_dependency "rspec", "~> 3.2"
32
- spec.add_development_dependency "simplecov", "~> 0.9"
31
+ spec.add_development_dependency "rspec", "~> 3.3"
32
+ spec.add_development_dependency "simplecov", "~> 0.10"
33
33
  spec.add_development_dependency "pry-byebug", "~> 3.1"
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photocopier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre2
4
+ version: 1.0.0.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2015-04-10 00:00:00.000000000 Z
13
+ date: 2015-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -102,28 +102,28 @@ dependencies:
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '3.2'
105
+ version: '3.3'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '3.2'
112
+ version: '3.3'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: simplecov
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0.9'
119
+ version: '0.10'
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: '0.9'
126
+ version: '0.10'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: pry-byebug
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: 1.3.1
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.4.6
191
+ rubygems_version: 2.4.8
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: Photocopier provides FTP/SSH adapters to abstract away file and directory