woothee 1.1.1 → 1.2.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
2
  SHA1:
3
- metadata.gz: c014eaeb7dddd4ad586f76066fdadb6c0585cdef
4
- data.tar.gz: 61bb29e14c857fe716a04144ce0bb53b061b48d7
3
+ metadata.gz: 44162a8c67cb953882dbe7e9d65148a68ef40742
4
+ data.tar.gz: 6d316209571959729e3cfaf4cc1ff96abf1860c9
5
5
  SHA512:
6
- metadata.gz: ef8c6a020c0712bbb2b3560a01458cc40ddd0b2d2ea2aacc9f5073e4e95986f3a7efc9215d06df09cd78397004635802b7a7612c7457ff4b8baae5b0b1db0d12
7
- data.tar.gz: 3cc4730be55cde4d26c537bf75c81d9751bfb6b82e8de1d5b3645212bacd4adac7feae84e5530d14db6e843107782fd3056426ddb89658661c817691b7526593
6
+ metadata.gz: 0ae44d2cace028c8bcd236d106b0a8c022c3848fe75d539832280081c88b4f334772e86618a3ef0ba985206998fa91fee10f3b06aa3e1f3c1f70f44bccce2fb4
7
+ data.tar.gz: 0a750dce5c17a0a4c9e9e06b793b33081571406d90f70ce8e33e4de9c19cc23df01993793017ed6c49cbb0da090440f0f4edb28e0d5ac23b64e0ae9635aec7c6
data/lib/woothee.rb CHANGED
@@ -77,6 +77,8 @@ module Woothee
77
77
 
78
78
  return true if Woothee::Browser.challenge_opera(useragent, result)
79
79
 
80
+ return true if Woothee::Browser.challenge_webview(useragent, result)
81
+
80
82
  false
81
83
  end
82
84
 
@@ -28,6 +28,14 @@ module Woothee::Browser
28
28
 
29
29
  version = Woothee::VALUE_UNKNOWN
30
30
 
31
+ # Edge
32
+ if ua =~ /Edge\/([.0-9]+)/o
33
+ version = $1
34
+ update_map(result, Woothee::DataSet.get('Edge'))
35
+ update_version(result, version)
36
+ return true
37
+ end
38
+
31
39
  if ua =~ /(?:Chrome|CrMo|CriOS)\/([.0-9]+)/o
32
40
  chrome_version = $1
33
41
 
@@ -82,6 +90,26 @@ module Woothee::Browser
82
90
  true
83
91
  end
84
92
 
93
+ def self.challenge_webview(ua, result)
94
+ version = Woothee::DataSet.get('VALUE_UNKNOWN')
95
+
96
+ # iOS
97
+ if ua =~ /iP(?:hone;|ad;|od) .*like Mac OS X/
98
+ return false if ua.index('Safari/')
99
+
100
+ version = if ua =~ /Version\/([.0-9]+)/
101
+ $1
102
+ else
103
+ Woothee::VALUE_UNKNOWN
104
+ end
105
+ update_map(result, Woothee::DataSet.get('Webview'))
106
+ update_version(result, version)
107
+ return true
108
+ end
109
+
110
+ false
111
+ end
112
+
85
113
  def self.challenge_sleipnir(ua, result)
86
114
  return false if ua.index('Sleipnir/').nil?
87
115
 
@@ -97,6 +97,10 @@ module Woothee::Crawler
97
97
  update_map(result, Woothee::DataSet.get('facebook'))
98
98
  return true
99
99
  end
100
+ if ua.index('Twitterbot/')
101
+ update_map(result, Woothee::DataSet.get('twitter'))
102
+ return true
103
+ end
100
104
  if ua.index('ichiro')
101
105
  if ua.index('http://help.goo.ne.jp/door/crawler.html') or ua.index('compatible; ichiro/mobile goo;')
102
106
  update_map(result, Woothee::DataSet.get('goo'))
@@ -35,10 +35,13 @@ end
35
35
 
36
36
  module Woothee::DataSet
37
37
  DATASET = {}
38
- # GENERATED from dataset.yaml at Wed Oct 22 20:17:46 JST 2014 by tagomoris
38
+ # GENERATED from dataset.yaml at Tue Aug 11 16:54:38 JST 2015 by tagomoris
39
39
  obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
40
40
  obj[:vendor] = 'Microsoft'
41
41
  DATASET[obj[:label]] = obj
42
+ obj = {:label => 'Edge', :name => 'Edge', :type => :browser}
43
+ obj[:vendor] = 'Microsoft'
44
+ DATASET[obj[:label]] = obj
42
45
  obj = {:label => 'Chrome', :name => 'Chrome', :type => :browser}
43
46
  obj[:vendor] = 'Google'
44
47
  DATASET[obj[:label]] = obj
@@ -54,9 +57,15 @@ module Woothee::DataSet
54
57
  obj = {:label => 'Sleipnir', :name => 'Sleipnir', :type => :browser}
55
58
  obj[:vendor] = 'Fenrir Inc.'
56
59
  DATASET[obj[:label]] = obj
60
+ obj = {:label => 'Webview', :name => 'Webview', :type => :browser}
61
+ obj[:vendor] = 'OS vendor'
62
+ DATASET[obj[:label]] = obj
57
63
  obj = {:label => 'Win', :name => 'Windows UNKNOWN Ver', :type => :os}
58
64
  obj[:category] = :pc
59
65
  DATASET[obj[:label]] = obj
66
+ obj = {:label => 'Win10', :name => 'Windows 10', :type => :os}
67
+ obj[:category] = :pc
68
+ DATASET[obj[:label]] = obj
60
69
  obj = {:label => 'Win8.1', :name => 'Windows 8.1', :type => :os}
61
70
  obj[:category] = :pc
62
71
  DATASET[obj[:label]] = obj
@@ -129,6 +138,9 @@ module Woothee::DataSet
129
138
  obj = {:label => 'BlackBerry', :name => 'BlackBerry', :type => :os}
130
139
  obj[:category] = :smartphone
131
140
  DATASET[obj[:label]] = obj
141
+ obj = {:label => 'BlackBerry10', :name => 'BlackBerry 10', :type => :os}
142
+ obj[:category] = :smartphone
143
+ DATASET[obj[:label]] = obj
132
144
  obj = {:label => 'docomo', :name => 'docomo', :type => :full}
133
145
  obj[:vendor] = 'docomo'
134
146
  obj[:category] = :mobilephone
@@ -282,6 +294,9 @@ module Woothee::DataSet
282
294
  obj = {:label => 'facebook', :name => 'facebook', :type => :full}
283
295
  obj[:category] = :crawler
284
296
  DATASET[obj[:label]] = obj
297
+ obj = {:label => 'twitter', :name => 'twitter', :type => :full}
298
+ obj[:category] = :crawler
299
+ DATASET[obj[:label]] = obj
285
300
  obj = {:label => 'mixi', :name => 'mixi', :type => :full}
286
301
  obj[:category] = :crawler
287
302
  DATASET[obj[:label]] = obj
data/lib/woothee/os.rb CHANGED
@@ -31,6 +31,7 @@ module Woothee::OS
31
31
 
32
32
  version = $1
33
33
  data = case
34
+ when version == 'NT 10.0' then Woothee::DataSet.get('Win10')
34
35
  when version == 'NT 6.3' then Woothee::DataSet.get('Win8.1')
35
36
  when version == 'NT 6.2' then Woothee::DataSet.get('Win8')
36
37
  when version == 'NT 6.1' then Woothee::DataSet.get('Win7')
@@ -116,6 +117,11 @@ module Woothee::OS
116
117
  data = Woothee::DataSet.get('Android')
117
118
  when ua.index('CFNetwork')
118
119
  data = Woothee::DataSet.get('iOS')
120
+ when ua.index('BB10')
121
+ data = Woothee::DataSet.get('BlackBerry10')
122
+ if ua =~ /BB10(?:.+)Version\/([.0-9]+)/
123
+ os_version = $1
124
+ end
119
125
  when ua.index('BlackBerry')
120
126
  data = Woothee::DataSet.get('BlackBerry')
121
127
  if ua =~ /BlackBerry(?:\d+)\/([.0-9]+) /
@@ -1,3 +1,3 @@
1
1
  module Woothee
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.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.1.1
4
+ version: 1.2.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: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -94,3 +94,4 @@ test_files:
94
94
  - spec/00_valid_spec.rb
95
95
  - spec/01_dataset_spec.rb
96
96
  - spec/02_run_testsets_spec.rb
97
+ has_rdoc: false