down 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/down.rb +5 -5
- data/lib/down/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0fd2b712dcfee3b7e3da1189103e57b2f67621
|
4
|
+
data.tar.gz: 9d812256dc29a14cd18d17517f8aef6d360cf37b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1174fbcef905d92928c24470f2a109fb6b96cdbc02819bfdae719e79959f3da091a76baf599f5ed2821eb42d254a56df43313fc4bcfa36d604a3553155c3e7df
|
7
|
+
data.tar.gz: c88b14d47f42bc78601e4cb97e86ff5b559dd25edd1c833e1638699eb04810e09cde0a77e700458b8be582f3a06a48439bc72b63b79801945523d1d4481a9f49
|
data/README.md
CHANGED
data/lib/down.rb
CHANGED
@@ -73,10 +73,10 @@ module Down
|
|
73
73
|
rescue OpenURI::HTTPRedirect => redirect
|
74
74
|
uri = redirect.uri
|
75
75
|
retry if (tries -= 1) > 0
|
76
|
-
raise Down::NotFound, "too many redirects
|
76
|
+
raise Down::NotFound, "too many redirects"
|
77
77
|
rescue => error
|
78
78
|
raise if error.is_a?(Down::Error)
|
79
|
-
raise Down::NotFound, "file not found
|
79
|
+
raise Down::NotFound, "file not found"
|
80
80
|
end
|
81
81
|
|
82
82
|
# open-uri will return a StringIO instead of a Tempfile if the filesize is
|
@@ -127,12 +127,12 @@ module Down
|
|
127
127
|
end
|
128
128
|
|
129
129
|
request_headers = options.select { |key, value| key.is_a?(String) }
|
130
|
+
get = Net::HTTP::Get.new(uri.request_uri, request_headers)
|
131
|
+
get.basic_auth(uri.user, uri.password) if uri.user || uri.password
|
130
132
|
|
131
133
|
request = Fiber.new do
|
132
134
|
http.start do
|
133
|
-
|
134
|
-
req.basic_auth(uri.user, uri.password) if uri.user || uri.password
|
135
|
-
http.request(req) do |response|
|
135
|
+
http.request(get) do |response|
|
136
136
|
Fiber.yield response
|
137
137
|
response.instance_variable_set("@read", true)
|
138
138
|
end
|
data/lib/down/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: down
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.6.11
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Robust streaming downloads using net/http.
|