photocopier 1.3.0.pre2 → 1.3.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/photocopier/ftp.rb +12 -8
- data/lib/photocopier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72ba7b1c1780d7ffe28bb8f97ed77abff3b238ff
|
4
|
+
data.tar.gz: 6a244dab5dd151d0826eb33e55a0bc3962f1af77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 550a1ab3dcfe359ae83010d1901376dd631cd9ae0a338e0ad380a6e4d6e30140ab70054c540bb9a2f03b03a6455aed3d54c015e158e40511467c4757b98ec516
|
7
|
+
data.tar.gz: 4560202cb98ce2e947bd1f0d3426fef96c3a63cffc7423ef068bd83edc2d8347c0eda88d6750274b93615c5f3a0b623458529c0a008469d4da3afb48e69d2bb7
|
data/lib/photocopier/ftp.rb
CHANGED
@@ -29,6 +29,16 @@ module Photocopier
|
|
29
29
|
lftp(local_path, remote_path, true, exclude, options[:port])
|
30
30
|
end
|
31
31
|
|
32
|
+
def inferred_port
|
33
|
+
if options[:port].nil? && options[:scheme] == 'sftp'
|
34
|
+
22
|
35
|
+
elsif options[:port].nil?
|
36
|
+
21
|
37
|
+
else
|
38
|
+
options[:port]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
32
42
|
private
|
33
43
|
|
34
44
|
def session
|
@@ -36,25 +46,19 @@ module Photocopier
|
|
36
46
|
end
|
37
47
|
|
38
48
|
def lftp(local, remote, reverse, exclude, port = nil)
|
39
|
-
if port.nil? && options[:scheme] == 'sftp'
|
40
|
-
port = 22
|
41
|
-
elsif port.nil?
|
42
|
-
port = 21
|
43
|
-
end
|
44
|
-
|
45
49
|
remote = Shellwords.escape(remote)
|
46
50
|
local = Shellwords.escape(local)
|
47
51
|
command = [
|
48
52
|
"set ftp:list-options -a",
|
49
53
|
"set cmd:fail-exit true",
|
50
|
-
"open #{remote_ftp_url}",
|
54
|
+
"open -p #{port || inferred_port} #{remote_ftp_url}",
|
51
55
|
"find -d 1 #{remote} || mkdir -p #{remote}",
|
52
56
|
"lcd #{local}",
|
53
57
|
"cd #{remote}",
|
54
58
|
lftp_mirror_arguments(reverse, exclude)
|
55
59
|
].join("; ")
|
56
60
|
|
57
|
-
run "lftp -c '#{command}'
|
61
|
+
run "lftp -c '#{command}'"
|
58
62
|
end
|
59
63
|
|
60
64
|
def remote_ftp_url
|
data/lib/photocopier/version.rb
CHANGED
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.3.0.
|
4
|
+
version: 1.3.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: 2018-07-
|
13
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|