ftpsync 0.0.2 → 0.0.3
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 +4 -4
- data/lib/ftpsync/version.rb +1 -1
- data/lib/ftpsync.rb +6 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2689b1b4483dd343c5134cf3b2ab3d9d4df23370
|
|
4
|
+
data.tar.gz: c41e14145fb02388f9debb57851cb5c1344a393b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44611aafdd803254a9ee6d2eaacbbb04185642f54135d5d972c5ab2fd6a938cc2472adeac2578124bf59c7f46a5b30c4d4918b3fb5d772ee592f1505af4044db
|
|
7
|
+
data.tar.gz: 040b442974299f24ed692a788804951c18e270891508830e794cfe6b37a3ad0d5b95ce086d61749e75f1e62c1b33701a207d778e57bf3c4ed6da6cb6da492b72
|
data/lib/ftpsync/version.rb
CHANGED
data/lib/ftpsync.rb
CHANGED
|
@@ -20,6 +20,7 @@ module FtpSync
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def pull_dir(remotepath, localpath, options = {}, &block)
|
|
23
|
+
FileUtils.mkpath(localpath) unless File.exist?(localpath) and log "Creating #{localpath} directory"
|
|
23
24
|
connect! unless @connection
|
|
24
25
|
@level += 1
|
|
25
26
|
|
|
@@ -48,6 +49,11 @@ module FtpSync
|
|
|
48
49
|
todelete.delete paths[1]
|
|
49
50
|
end
|
|
50
51
|
|
|
52
|
+
directories.each do |paths|
|
|
53
|
+
remotedir, localdir = paths
|
|
54
|
+
pull_dir(remotedir, localdir, options, &block)
|
|
55
|
+
end
|
|
56
|
+
|
|
51
57
|
files.each do |paths|
|
|
52
58
|
remotefile, localfile = paths
|
|
53
59
|
begin
|
|
@@ -59,13 +65,6 @@ module FtpSync
|
|
|
59
65
|
end
|
|
60
66
|
end
|
|
61
67
|
|
|
62
|
-
directories.each do |paths|
|
|
63
|
-
remotedir, localdir = paths
|
|
64
|
-
log "Creating #{localdir} directory"
|
|
65
|
-
FileUtils.mkpath(localdir) unless File.exists?(localdir)
|
|
66
|
-
pull_dir(remotedir, localdir, options, &block)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
68
|
@level -= 1
|
|
70
69
|
close! if @level == 0
|
|
71
70
|
end
|