urifetch 0.1.1.rc1 → 0.1.1.rc2
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.
- data/lib/urifetch/strategy/base.rb +3 -3
- data/lib/urifetch/version.rb +1 -1
- data/urifetch.gemspec +1 -1
- metadata +2 -2
|
@@ -66,7 +66,7 @@ module Urifetch
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
favicon = doc.css('link[rel="shortcut icon"], link[rel="icon shortcut"], link[rel="shortcut"], link[rel="icon"]').first
|
|
69
|
-
favicon = favicon.nil? ? nil : favicon['href'].strip
|
|
69
|
+
favicon = favicon.nil? ? nil : favicon['href'].try(:strip)
|
|
70
70
|
if favicon
|
|
71
71
|
if favicon.match(/^https?:\/\//i).nil?
|
|
72
72
|
favicon = uri.scheme + "://" + uri.host.sub(/\/$/,"") + "/" + favicon.sub(/^\//,"")
|
|
@@ -76,12 +76,12 @@ module Urifetch
|
|
|
76
76
|
|
|
77
77
|
# Fallback Image
|
|
78
78
|
image = doc.css('img').first
|
|
79
|
-
image = image.
|
|
79
|
+
image = image.nil? ? nil : image['src'].try(:strip)
|
|
80
80
|
if image
|
|
81
81
|
if image.match(/^https?:\/\//i).nil?
|
|
82
82
|
image = uri.scheme + "://" + uri.host.sub(/\/$/,"") + "/" + image.sub(/^\//,"")
|
|
83
83
|
end
|
|
84
|
-
set :image, image
|
|
84
|
+
set :image, image
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
end
|
data/lib/urifetch/version.rb
CHANGED
data/urifetch.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: urifetch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.1.
|
|
4
|
+
version: 0.1.1.rc2
|
|
5
5
|
prerelease: 6
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -249,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
249
249
|
version: '0'
|
|
250
250
|
segments:
|
|
251
251
|
- 0
|
|
252
|
-
hash: -
|
|
252
|
+
hash: -2471685244619805773
|
|
253
253
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
none: false
|
|
255
255
|
requirements:
|