dbox 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/dbox.gemspec +2 -2
- data/lib/dbox/api.rb +8 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
data/dbox.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dbox"
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.4"
|
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 = "
|
12
|
+
s.date = "2013-04-10"
|
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"]
|
data/lib/dbox/api.rb
CHANGED
@@ -208,7 +208,7 @@ module Dbox
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
|
211
|
-
def streaming_download(url, io)
|
211
|
+
def streaming_download(url, io, num_redirects = 0)
|
212
212
|
url = URI.parse(url)
|
213
213
|
http = Net::HTTP.new(url.host, url.port)
|
214
214
|
http.use_ssl = true
|
@@ -224,7 +224,13 @@ module Dbox
|
|
224
224
|
res.read_body {|chunk| io.write(chunk) }
|
225
225
|
true
|
226
226
|
else
|
227
|
-
|
227
|
+
if res.kind_of?(Net::HTTPRedirection) && res.header['location'] && num_redirects < 10
|
228
|
+
log.info("following redirect, num_redirects = #{num_redirects}")
|
229
|
+
log.info("redirect url: #{res.header['location']}")
|
230
|
+
streaming_download(res.header['location'], io, num_redirects + 1)
|
231
|
+
else
|
232
|
+
raise DropboxError.new("Invalid response #{res.inspect}")
|
233
|
+
end
|
228
234
|
end
|
229
235
|
end
|
230
236
|
end
|
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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 4
|
10
|
+
version: 0.7.4
|
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:
|
18
|
+
date: 2013-04-10 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: multipart-post
|