woothee 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/woothee.rb +2 -0
- data/lib/woothee/browser.rb +13 -0
- data/lib/woothee/dataset.rb +4 -1
- data/lib/woothee/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fe0f7e098f6e8054dd12b42b4f231446d2adfdfcda1da42a482c254876f49f73
|
4
|
+
data.tar.gz: ac9e99c0039bd8fd2b0ac04cc2bd60cb6bb1c8b55b81198b1703ca27c02d3400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c7c421028759196c13b46f92910df256b24523ddd6f462493dcf59c77ce8c7573af7c9b5afea2bfaca176d9788ea5feee2362c99b478e66b5e4cb91edfb563f
|
7
|
+
data.tar.gz: 6bc3c434f0a18776606c12fed9d82c4351da0257b506547aa212fa036bf1144797b26f40f81a54a5a9eb49f34a7cca34951fa769b3fa91e9d83bb58a542dfb47
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Woothee.is_crawler("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4
|
|
56
56
|
# => false
|
57
57
|
```
|
58
58
|
|
59
|
-
Try to see useragent's category is 'crawler' or not, by casual(fast) method. Minor case of crawlers is not tested in this method. To check crawler strictly, use `Woothee.parse(str)[:category] ==
|
59
|
+
Try to see useragent's category is 'crawler' or not, by casual(fast) method. Minor case of crawlers is not tested in this method. To check crawler strictly, use `Woothee.parse(str)[:category] == :crawler`.
|
60
60
|
|
61
61
|
* * * * *
|
62
62
|
|
data/lib/woothee.rb
CHANGED
@@ -73,6 +73,8 @@ module Woothee
|
|
73
73
|
|
74
74
|
return true if Woothee::Browser.challenge_vivaldi(useragent, result)
|
75
75
|
|
76
|
+
return true if Woothee::Browser.challenge_yandexbrowser(useragent, result)
|
77
|
+
|
76
78
|
return true if Woothee::Browser.challenge_safari_chrome(useragent, result)
|
77
79
|
|
78
80
|
return true if Woothee::Browser.challenge_firefox(useragent, result)
|
data/lib/woothee/browser.rb
CHANGED
@@ -23,6 +23,19 @@ module Woothee::Browser
|
|
23
23
|
true
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.challenge_yandexbrowser(ua, result)
|
27
|
+
return false if ua.index('YaBrowser/').nil?
|
28
|
+
|
29
|
+
version = Woothee::VALUE_UNKNOWN
|
30
|
+
if ua =~ /YaBrowser\/([.0-9]+)/o
|
31
|
+
version = $1
|
32
|
+
end
|
33
|
+
|
34
|
+
update_map(result, Woothee::DataSet.get('YaBrowser'))
|
35
|
+
update_version(result, version)
|
36
|
+
true
|
37
|
+
end
|
38
|
+
|
26
39
|
def self.challenge_safari_chrome(ua, result)
|
27
40
|
return false if ua.index('Safari/').nil?
|
28
41
|
return false if ua.index('Chrome') && ua.index('wv')
|
data/lib/woothee/dataset.rb
CHANGED
@@ -35,7 +35,7 @@ end
|
|
35
35
|
|
36
36
|
module Woothee::DataSet
|
37
37
|
DATASET = {}
|
38
|
-
# GENERATED from dataset.yaml at
|
38
|
+
# GENERATED from dataset.yaml at Sun Jul 22 00:57:28 JST 2018 by tell_k
|
39
39
|
obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
|
40
40
|
obj[:vendor] = 'Microsoft'
|
41
41
|
DATASET[obj[:label]] = obj
|
@@ -63,6 +63,9 @@ module Woothee::DataSet
|
|
63
63
|
obj = {:label => 'Webview', :name => 'Webview', :type => :browser}
|
64
64
|
obj[:vendor] = 'OS vendor'
|
65
65
|
DATASET[obj[:label]] = obj
|
66
|
+
obj = {:label => 'YaBrowser', :name => 'Yandex Browser', :type => :browser}
|
67
|
+
obj[:vendor] = 'Yandex'
|
68
|
+
DATASET[obj[:label]] = obj
|
66
69
|
obj = {:label => 'Win', :name => 'Windows UNKNOWN Ver', :type => :os}
|
67
70
|
obj[:category] = :pc
|
68
71
|
DATASET[obj[:label]] = obj
|
data/lib/woothee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woothee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.6
|
89
|
+
rubygems_version: 2.7.6
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Cross-language UserAgent classifier library, ruby implementation
|