fastimage 1.5.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastimage.rb +4 -5
  3. data/test/test.rb +8 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a02b98b4a5111c9df579f8fb6a04fd28e46aeeae
4
- data.tar.gz: b88b2fb0d0b343d42d7de8a431fa94e0db3c8f86
3
+ metadata.gz: fb9d75d5620c240241218d8a9dc5219882bdaf56
4
+ data.tar.gz: 6df2e5e2117e2e7595dc2492e904e76109762c67
5
5
  SHA512:
6
- metadata.gz: 34fc61b9355c98f017626b9e7359075d95c6247ac9f20d53e5f2484c450546aa76c23214c37f6844df69939910b94715686600a676bfb867fe7f3aa8a770c480
7
- data.tar.gz: 75809b1269410e5be54bb89104008c4e8350f4df63439306c325abc52a10e0232b52cffb0a818b1bb1fcda71cbf23d5725490c14701c95f02ddc010ecce264c7
6
+ metadata.gz: 91d8c6996afb13c592796d913ddf35f015e1191bdca7d1402b63df88f54ede5fd72b9409fe14fb44ce7911f0a075bb74a453a9a4d84c95bfe6b3249c28714f27
7
+ data.tar.gz: ab50ea1309e9f60c1c8ca2d65e75634cd3b64a3f0ccffe637394513083d9faa51ca7e2145924ebe4defb4b06f0dcc4f306f69fde4db9612dad61a3f97c650d8d
@@ -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.port)
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.port)
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
@@ -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.3
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-10-26 00:00:00.000000000 Z
11
+ date: 2013-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable