dbox 0.6.2 → 0.6.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.
@@ -1,3 +1,7 @@
1
+ == 0.6.3 / 2011-11-29
2
+ * Bug Fixes
3
+ * Fixed crash when multiple Dropbox operations fail.
4
+
1
5
  == 0.6.2 / 2011-11-24
2
6
  * Bug Fixes
3
7
  * Fixed db migration.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "dbox"
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ken Pratt"]
12
- s.date = "2011-11-24"
12
+ s.date = "2011-11-29"
13
13
  s.description = "An easy-to-use Dropbox client with fine-grained control over syncs."
14
14
  s.email = "ken@kenpratt.net"
15
15
  s.executables = ["dbox"]
@@ -202,7 +202,7 @@ module Dbox
202
202
  res.read_body {|chunk| io.write(chunk) }
203
203
  true
204
204
  else
205
- raise DropboxError.new("Invalid response #{res}\n#{res.body}")
205
+ raise DropboxError.new("Invalid response #{res.inspect}")
206
206
  end
207
207
  end
208
208
  end
@@ -148,6 +148,20 @@ module Dbox
148
148
  def remove_tmpfiles
149
149
  Dir["#{local_path}/.*.part"].each {|f| FileUtils.rm(f) }
150
150
  end
151
+
152
+ def sort_changelist(changelist)
153
+ changelist.keys.each do |k|
154
+ case k
155
+ when :conflicts
156
+ changelist[k].sort! {|c1, c2| c1[:original] <=> c2[:original] }
157
+ when :failed
158
+ changelist[k].sort! {|c1, c2| c1[:path] <=> c2[:path] }
159
+ else
160
+ changelist[k].sort!
161
+ end
162
+ end
163
+ changelist
164
+ end
151
165
  end
152
166
 
153
167
  class Pull < Operation
@@ -243,8 +257,7 @@ module Dbox
243
257
  end
244
258
 
245
259
  # sort & return output
246
- changelist.keys.each {|k| k == :conflicts ? changelist[k].sort! {|c1, c2| c1[:original] <=> c2[:original] } : changelist[k].sort! }
247
- changelist
260
+ sort_changelist(changelist)
248
261
  end
249
262
 
250
263
  def calculate_changes(dir, operation = :update)
@@ -518,8 +531,7 @@ module Dbox
518
531
  ptasks.finish
519
532
 
520
533
  # sort & return output
521
- changelist.keys.each {|k| changelist[k].sort! }
522
- changelist
534
+ sort_changelist(changelist)
523
535
  end
524
536
 
525
537
  def calculate_changes(dir)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Pratt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-24 00:00:00 Z
18
+ date: 2011-11-29 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: multipart-post