discourse_fastimage 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastimage.rb +14 -11
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dd97a14da5787f1f82ae57afd2a8821d243d717
|
4
|
+
data.tar.gz: 4e495c390dc590639415b083e4c129136b2ef286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fcce40e46e85175d796c1eccd02db987ac20b105aea3ddd4a3dca044283ecdb3b26246cfbaf59698c1a9da87e029fe7dda33a5a5d95d12b1b5a2f71908df64b
|
7
|
+
data.tar.gz: c31bb94ab9259551018c63f393e76939ebabaf8025b7996659436b84a454a5004c55d3e7ac1f912a1118460d5bfac4b7f14394945cf4b8d31d13ff492b37e943
|
data/lib/fastimage.rb
CHANGED
@@ -222,10 +222,11 @@ class FastImage
|
|
222
222
|
|
223
223
|
raise SizeNotFound if @options[:raise_on_failure] && @property == :size && !@size
|
224
224
|
|
225
|
-
rescue Timeout::Error,
|
226
|
-
|
227
|
-
|
228
|
-
|
225
|
+
rescue Timeout::Error,
|
226
|
+
Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNRESET, Errno::ENOENT,
|
227
|
+
Net::HTTPBadResponse,
|
228
|
+
SocketError, EOFError, IOError, NoMethodError,
|
229
|
+
ImageFetchFailure
|
229
230
|
raise ImageFetchFailure if @options[:raise_on_failure]
|
230
231
|
rescue UnknownImageType
|
231
232
|
raise UnknownImageType if @options[:raise_on_failure]
|
@@ -476,11 +477,13 @@ class FastImage
|
|
476
477
|
when "<s"
|
477
478
|
:svg
|
478
479
|
when "<?"
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
480
|
+
first_100_characters = @stream.peek(100) rescue nil
|
481
|
+
return :svg if first_100_characters && first_100_characters.include?("<svg")
|
482
|
+
|
483
|
+
next_100_characters = @stream.peek(100) rescue nil
|
484
|
+
return :svg if next_100_characters && next_100_characters.include?("<svg")
|
485
|
+
|
486
|
+
raise UnknownImageType
|
484
487
|
else
|
485
488
|
raise UnknownImageType
|
486
489
|
end
|
@@ -710,12 +713,12 @@ class FastImage
|
|
710
713
|
values = attr_value.split(/\s/)
|
711
714
|
@ratio = values[2].to_f / values[3].to_f
|
712
715
|
end
|
713
|
-
when
|
716
|
+
when /[<\w]/
|
714
717
|
attr_name << char
|
715
718
|
when ">"
|
716
719
|
state = :stop if state == :started
|
717
720
|
else
|
718
|
-
state = :started if attr_name.join == "svg"
|
721
|
+
state = :started if attr_name.join == "<svg"
|
719
722
|
attr_name.clear
|
720
723
|
end
|
721
724
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discourse_fastimage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: addressable
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: fakeweb
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|