user_agent_list 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00b45e452c4585e20dd156daaba7df05f1c31833
4
- data.tar.gz: f6828758149b5d42352943b2a8ee5d593a581ad4
3
+ metadata.gz: 1dfe3baa0c5c0d72c8ead7a355a1980eda050301
4
+ data.tar.gz: 5b677d1b1cd9f1c2f94f661d9f92ef56b6642157
5
5
  SHA512:
6
- metadata.gz: 9bf5c098331b65cce3212ab96a4924b88ce370a6473e7200da0510574d9401b1fc9d30893af94710ada1e7c5a5c8a3b75916fe78a90c46c32cf1313d6ab59122
7
- data.tar.gz: 8dcb30205f33da73ac01344d0e4c34559dfc14b9de31b75161e6079ea5d82025a8686172687a069c3f564ba6e62c58fd83b473d24af421f4e077b73db6dcc795
6
+ metadata.gz: 905a41575649a47c56f3634a56e9d6079dc8c53edd1dc9d0a940527d2386e5196f062ac337bd514ba0796cfebc1e159155af2e7b79f423c4f01837e5d1c5ef59
7
+ data.tar.gz: c1f50f2e7ec475733d66b83bb22f86a397f27640a8b824d3bf01a2d6b3597087e65d7351cfacead623343ae6c4ddc491dd4a46c183e46bcd61cba5cd888e6168
@@ -33,3 +33,5 @@ module UserAgentList
33
33
  SUPPORTED_BROWSERS
34
34
  end
35
35
  end
36
+
37
+ puts UserAgentList.by_browser("ABrowse").inspect
@@ -4,9 +4,10 @@ module UserAgentList
4
4
  result = {}
5
5
  parser.css('h3').each do |item|
6
6
  parser.css("a:contains('#{item.text}')").each do |link|
7
- result[item] ||= []
8
- result[item] << link.children.text
7
+ result[item.text] ||= []
8
+ result[item.text] << link.children.text unless link.children.text =~ /-->>/
9
9
  end
10
+ result.delete(item.text) if result[item.text] && result[item.text].empty?
10
11
  end
11
12
  result
12
13
  end
@@ -16,7 +17,7 @@ module UserAgentList
16
17
 
17
18
  result = []
18
19
  parser.css("a:contains('#{string}')").each do |link|
19
- result << link.children.text
20
+ result << link.children.text unless link.children.text =~ /-->>/
20
21
  end
21
22
  result
22
23
  end
@@ -1,3 +1,3 @@
1
1
  module UserAgentList
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_agent_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chebyte