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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11c709f1e1176dbe6a596cc718be60e343ed396f
4
- data.tar.gz: 01478d530e2b3db292ee63735da296a0119a6001
3
+ metadata.gz: 2689b1b4483dd343c5134cf3b2ab3d9d4df23370
4
+ data.tar.gz: c41e14145fb02388f9debb57851cb5c1344a393b
5
5
  SHA512:
6
- metadata.gz: 1de782f696ce768b2d3bff5eb4a5d2bf580e6d672cd2ca8e1ebe10db20ee7e90f87f0311309e64032ea55d3e23b5e7f9c3d33e796ddf74ade0d8d7589a1cea2d
7
- data.tar.gz: f10c0629583d314662f4d78e6dbe656ad8f38f2dca44571c70d46ab2ea74efdd267058241d2df82f9198231e752a9ae50e9918933b40a6aaf5bd0cd0b0074c63
6
+ metadata.gz: 44611aafdd803254a9ee6d2eaacbbb04185642f54135d5d972c5ab2fd6a938cc2472adeac2578124bf59c7f46a5b30c4d4918b3fb5d772ee592f1505af4044db
7
+ data.tar.gz: 040b442974299f24ed692a788804951c18e270891508830e794cfe6b37a3ad0d5b95ce086d61749e75f1e62c1b33701a207d778e57bf3c4ed6da6cb6da492b72
@@ -1,3 +1,3 @@
1
1
  module FtpSync
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftpsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Zając