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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 75fbedaeb0a5bfd189803a040fbafbb58a997c2b
4
- data.tar.gz: 8fe27707e281642e70de3f5807fe50b67ee05ed1
2
+ SHA256:
3
+ metadata.gz: fe0f7e098f6e8054dd12b42b4f231446d2adfdfcda1da42a482c254876f49f73
4
+ data.tar.gz: ac9e99c0039bd8fd2b0ac04cc2bd60cb6bb1c8b55b81198b1703ca27c02d3400
5
5
  SHA512:
6
- metadata.gz: 69dc257d2c9a05fc680edec8c7d742ae595d71b3d94d16b4d5dc3582ba45c03d88827f80ba7b0ffa4c56b40a0fbc91faaffd2936d2d42276feb0de5e6251e2c7
7
- data.tar.gz: 8bd673b6a3de030d3b1a4e3daa6a5986c2ea8af10f821defb16f8672b8dae840ef65f884adb83bf94310b7c7c1652ce97777417deff0b16797aa5b46e9dba2b2
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] == 'crawler'`.
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
 
@@ -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)
@@ -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')
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  module Woothee::DataSet
37
37
  DATASET = {}
38
- # GENERATED from dataset.yaml at Sat Apr 29 16:14:32 JST 2017 by yuya
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
@@ -1,3 +1,3 @@
1
1
  module Woothee
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
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.7.0
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: 2017-05-02 00:00:00.000000000 Z
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.11
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