richurls 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9cd9e82d9d29588c3bb14b489d64e576122be0ddda73b201666c618e8c4ffdd
4
- data.tar.gz: 8c0eeca52bb8c0aab4e473cde5a51328ba6da040f9f1d35106614ea86ee1d92f
3
+ metadata.gz: 4486b68e5e043f9ea570be7f89d147a2c443130740819d850c0c5664831b1662
4
+ data.tar.gz: 6eb6146c94e4ac4f2efd55ece0c2bcc9792a4e2deb80750e0d2817f37f5f1e44
5
5
  SHA512:
6
- metadata.gz: bcadc8f1f4bc37d3cc01736fc50b67069522d83a719198e449eadfaf5c594ab97e009ce1e0ec073226df447e9ad7e050ebec90e9133e93f33fd5da66c7aa2093
7
- data.tar.gz: f77ba6721d869163c79666538d581b43d00dfa8807d4e43ea75152f47f11dd46c3db63557b12520729dfb4e8f43842dc3eda5580e5d1419b7a5252db76ee57c9
6
+ metadata.gz: b7c6512cecef58f082a2dcfb9e53390966eb553df0c7d7e907461518a182d792bf75a9922a78dd9892d6fb476fa14aedb9b2de6d798915e238de8d217dbd4898
7
+ data.tar.gz: 376d658ae758094622037321413a59e951ac09d087b04b8e2a60d2826a0453cf3f7b0e437ef06e15b9d6eab5526637ec3ea130c723c5deec348bbbcb25bc2fe3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- richurls (0.1.8)
4
+ richurls (0.1.9)
5
5
  oj (~> 3)
6
6
  ox (~> 2)
7
7
  patron (~> 0.13)
@@ -1,7 +1,9 @@
1
1
  module Parsers
2
2
  FaviconParser = lambda do |document, url|
3
- favicon_el = document.find(:link, rel: 'shortcut icon')
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
- el.attributes[key] == val
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
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'richurls'
6
- spec.version = '0.1.8'
6
+ spec.version = '0.1.9'
7
7
  spec.authors = ['grdw']
8
8
  spec.email = ['gerard@wetransfer.com']
9
9
 
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.8
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-17 00:00:00.000000000 Z
11
+ date: 2020-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj