richurls 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/parsers/favicon_parser.rb +4 -2
- data/lib/xml_handler.rb +7 -1
- data/richurls.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4486b68e5e043f9ea570be7f89d147a2c443130740819d850c0c5664831b1662
|
4
|
+
data.tar.gz: 6eb6146c94e4ac4f2efd55ece0c2bcc9792a4e2deb80750e0d2817f37f5f1e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7c6512cecef58f082a2dcfb9e53390966eb553df0c7d7e907461518a182d792bf75a9922a78dd9892d6fb476fa14aedb9b2de6d798915e238de8d217dbd4898
|
7
|
+
data.tar.gz: 376d658ae758094622037321413a59e951ac09d087b04b8e2a60d2826a0453cf3f7b0e437ef06e15b9d6eab5526637ec3ea130c723c5deec348bbbcb25bc2fe3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module Parsers
|
2
2
|
FaviconParser = lambda do |document, url|
|
3
|
-
favicon_el = document.find(:link, rel:
|
3
|
+
favicon_el = document.find(:link, rel: %w[shortcut icon])
|
4
|
+
icon_el = document.find(:link, rel: %w[icon])
|
4
5
|
|
5
|
-
favicon_el && UrlHelper.url_for(url, favicon_el.attributes[:href])
|
6
|
+
(favicon_el && UrlHelper.url_for(url, favicon_el.attributes[:href])) ||
|
7
|
+
(icon_el && UrlHelper.url_for(url, icon_el.attributes[:href]))
|
6
8
|
end
|
7
9
|
end
|
data/lib/xml_handler.rb
CHANGED
@@ -29,7 +29,13 @@ module RichUrls
|
|
29
29
|
def find(name, attributes = {})
|
30
30
|
@elements.detect do |el|
|
31
31
|
matching_attributes = attributes.all? do |key, val|
|
32
|
-
|
32
|
+
if val.is_a?(Array)
|
33
|
+
result = el.attributes.fetch(key, '').split(' ')
|
34
|
+
|
35
|
+
val.all? { |sub_val| result.include?(sub_val) }
|
36
|
+
else
|
37
|
+
el.attributes[key] == val
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
el.name == name && matching_attributes
|
data/richurls.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: richurls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- grdw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|