down 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/down.rb +5 -5
  4. data/lib/down/version.rb +1 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b36995e341763d157bd7dfc5e4de2aeee8f7d42e
4
- data.tar.gz: f4f910e36886c4c64a1f6528a8f773716e28e940
3
+ metadata.gz: 0b0fd2b712dcfee3b7e3da1189103e57b2f67621
4
+ data.tar.gz: 9d812256dc29a14cd18d17517f8aef6d360cf37b
5
5
  SHA512:
6
- metadata.gz: 7c01afed653ed786903043d1b745afa99ec35d5e892d37df644171aad47d2d13a4bda3d98df5ebc890684180488fff62364537c78256e71d2a52c68fd2c69898
7
- data.tar.gz: 1b61d561a3a0088c8df2e208cd71d15b8a4314de31a1f40d881eeda067396fbc5d0c80d6f78e6796f847717abbd0da3cf813b41cf7fb47dd10cd58e4a1f22454
6
+ metadata.gz: 1174fbcef905d92928c24470f2a109fb6b96cdbc02819bfdae719e79959f3da091a76baf599f5ed2821eb42d254a56df43313fc4bcfa36d604a3553155c3e7df
7
+ data.tar.gz: c88b14d47f42bc78601e4cb97e86ff5b559dd25edd1c833e1638699eb04810e09cde0a77e700458b8be582f3a06a48439bc72b63b79801945523d1d4481a9f49
data/README.md CHANGED
@@ -223,8 +223,9 @@ tempfile.path #=> "/var/folders/k7/6zx6dx6x7ys3rv3srh0nyfj00000gn/T/down20151116
223
223
  * MRI 2.0
224
224
  * MRI 2.1
225
225
  * MRI 2.2
226
+ * MRI 2.3
227
+ * MRI 2.4
226
228
  * JRuby
227
- * Rubinius
228
229
 
229
230
  ## Development
230
231
 
@@ -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: #{uri.to_s}"
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: #{uri.to_s}"
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
- req = Net::HTTP::Get.new(uri.request_uri, request_headers)
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
@@ -1,3 +1,3 @@
1
1
  module Down
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
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.0
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-03 00:00:00.000000000 Z
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.5.1
117
+ rubygems_version: 2.6.11
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Robust streaming downloads using net/http.