fastimage 1.5.3 → 1.5.4
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 +4 -4
- data/lib/fastimage.rb +4 -5
- data/test/test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9d75d5620c240241218d8a9dc5219882bdaf56
|
4
|
+
data.tar.gz: 6df2e5e2117e2e7595dc2492e904e76109762c67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d8c6996afb13c592796d913ddf35f015e1191bdca7d1402b63df88f54ede5fd72b9409fe14fb44ce7911f0a075bb74a453a9a4d84c95bfe6b3249c28714f27
|
7
|
+
data.tar.gz: ab50ea1309e9f60c1c8ca2d65e75634cd3b64a3f0ccffe637394513083d9faa51ca7e2145924ebe4defb4b06f0dcc4f306f69fde4db9612dad61a3f97c650d8d
|
data/lib/fastimage.rb
CHANGED
@@ -230,7 +230,7 @@ class FastImage
|
|
230
230
|
Fiber.yield str
|
231
231
|
end
|
232
232
|
end
|
233
|
-
|
233
|
+
|
234
234
|
parse_packets
|
235
235
|
|
236
236
|
break # needed to actively quit out of the fetch
|
@@ -250,11 +250,10 @@ class FastImage
|
|
250
250
|
proxy = proxy_uri
|
251
251
|
|
252
252
|
if proxy
|
253
|
-
@http = Net::HTTP::Proxy(proxy.host, proxy.port).new(@parsed_uri.host, @parsed_uri.
|
253
|
+
@http = Net::HTTP::Proxy(proxy.host, proxy.port).new(@parsed_uri.host, @parsed_uri.inferred_port)
|
254
254
|
else
|
255
|
-
@http = Net::HTTP.new(@parsed_uri.host, @parsed_uri.
|
255
|
+
@http = Net::HTTP.new(@parsed_uri.host, @parsed_uri.inferred_port)
|
256
256
|
end
|
257
|
-
|
258
257
|
@http.use_ssl = (@parsed_uri.scheme == "https")
|
259
258
|
@http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
260
259
|
@http.open_timeout = @timeout
|
@@ -283,7 +282,7 @@ class FastImage
|
|
283
282
|
@strpos = 0
|
284
283
|
@bytes_read = 0
|
285
284
|
@bytes_delivered = 0
|
286
|
-
|
285
|
+
|
287
286
|
begin
|
288
287
|
result = send("parse_#{@property}")
|
289
288
|
if result
|
data/test/test.rb
CHANGED
@@ -36,6 +36,9 @@ LargeImage = "http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_
|
|
36
36
|
LargeImageInfo = [:jpeg, [9545, 6623]]
|
37
37
|
LargeImageFetchLimit = 2 # seconds
|
38
38
|
|
39
|
+
HTTPSImage = "https://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
|
40
|
+
HTTPSImageInfo = [:jpeg, [9545, 6623]]
|
41
|
+
|
39
42
|
GoodFixtures.each do |fn, info|
|
40
43
|
FakeWeb.register_uri(:get, "#{TestUrl}#{fn}", :body => File.join(FixturePath, fn))
|
41
44
|
end
|
@@ -222,4 +225,9 @@ class FastImageTest < Test::Unit::TestCase
|
|
222
225
|
ENV['http_proxy'] = nil
|
223
226
|
assert_equal actual_size, size
|
224
227
|
end
|
228
|
+
|
229
|
+
def test_should_handle_https_image
|
230
|
+
size = FastImage.size(HTTPSImage)
|
231
|
+
assert_equal HTTPSImageInfo[1], size
|
232
|
+
end
|
225
233
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastimage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|