device_detector 0.9.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +49 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +5 -9
  5. data/CHANGELOG.md +16 -3
  6. data/README.md +7 -9
  7. data/Rakefile +19 -13
  8. data/device_detector.gemspec +1 -0
  9. data/lib/device_detector.rb +32 -28
  10. data/lib/device_detector/bot.rb +2 -2
  11. data/lib/device_detector/client.rb +3 -2
  12. data/lib/device_detector/device.rb +44 -21
  13. data/lib/device_detector/memory_cache.rb +26 -19
  14. data/lib/device_detector/metadata_extractor.rb +7 -8
  15. data/lib/device_detector/model_extractor.rb +3 -3
  16. data/lib/device_detector/name_extractor.rb +2 -2
  17. data/lib/device_detector/os.rb +121 -111
  18. data/lib/device_detector/parser.rb +22 -9
  19. data/lib/device_detector/version.rb +3 -1
  20. data/lib/device_detector/version_extractor.rb +2 -3
  21. data/regexes/bots.yml +840 -20
  22. data/regexes/client/browser_engine.yml +11 -2
  23. data/regexes/client/browsers.yml +909 -108
  24. data/regexes/client/feed_readers.yml +38 -2
  25. data/regexes/client/libraries.yml +76 -2
  26. data/regexes/client/mediaplayers.yml +25 -5
  27. data/regexes/client/mobile_apps.yml +167 -2
  28. data/regexes/client/pim.yml +10 -1
  29. data/regexes/device/cameras.yml +1 -1
  30. data/regexes/device/car_browsers.yml +7 -3
  31. data/regexes/device/consoles.yml +3 -3
  32. data/regexes/device/mobiles.yml +10123 -465
  33. data/regexes/device/portable_media_player.yml +4 -6
  34. data/regexes/device/televisions.yml +18 -4
  35. data/regexes/oss.yml +115 -21
  36. data/regexes/vendorfragments.yml +6 -2
  37. data/spec/device_detector/concrete_user_agent_spec.rb +16 -17
  38. data/spec/device_detector/detector_fixtures_spec.rb +51 -11
  39. data/spec/device_detector/device_spec.rb +28 -48
  40. data/spec/device_detector/memory_cache_spec.rb +60 -28
  41. data/spec/device_detector/model_extractor_spec.rb +3 -3
  42. data/spec/device_detector/version_extractor_spec.rb +5 -6
  43. data/spec/device_detector_spec.rb +60 -69
  44. data/spec/fixtures/client/browser.yml +1785 -262
  45. data/spec/fixtures/client/feed_reader.yml +47 -35
  46. data/spec/fixtures/client/library.yml +112 -3
  47. data/spec/fixtures/client/mediaplayer.yml +32 -37
  48. data/spec/fixtures/client/mobile_app.yml +193 -6
  49. data/spec/fixtures/client/pim.yml +37 -18
  50. data/spec/fixtures/detector/bots.yml +1426 -118
  51. data/spec/fixtures/detector/camera.yml +36 -10
  52. data/spec/fixtures/detector/car_browser.yml +64 -3
  53. data/spec/fixtures/detector/console.yml +80 -26
  54. data/spec/fixtures/detector/desktop.yml +2222 -1589
  55. data/spec/fixtures/detector/feature_phone.yml +151 -42
  56. data/spec/fixtures/detector/feed_reader.yml +186 -121
  57. data/spec/fixtures/detector/mediaplayer.yml +113 -39
  58. data/spec/fixtures/detector/mobile_apps.yml +366 -21
  59. data/spec/fixtures/detector/phablet.yml +2597 -570
  60. data/spec/fixtures/detector/portable_media_player.yml +41 -16
  61. data/spec/fixtures/detector/smart_display.yml +8 -5
  62. data/spec/fixtures/detector/smart_speaker.yml +55 -0
  63. data/spec/fixtures/detector/smartphone-1.yml +5468 -5010
  64. data/spec/fixtures/detector/smartphone-10.yml +9977 -0
  65. data/spec/fixtures/detector/smartphone-11.yml +9891 -0
  66. data/spec/fixtures/detector/smartphone-12.yml +9906 -0
  67. data/spec/fixtures/detector/smartphone-13.yml +9920 -0
  68. data/spec/fixtures/detector/smartphone-14.yml +2662 -0
  69. data/spec/fixtures/detector/smartphone-2.yml +5213 -4635
  70. data/spec/fixtures/detector/smartphone-3.yml +5082 -4533
  71. data/spec/fixtures/detector/smartphone-4.yml +6806 -2625
  72. data/spec/fixtures/detector/smartphone-5.yml +9914 -0
  73. data/spec/fixtures/detector/smartphone-6.yml +9962 -0
  74. data/spec/fixtures/detector/smartphone-7.yml +9899 -0
  75. data/spec/fixtures/detector/smartphone-8.yml +9931 -0
  76. data/spec/fixtures/detector/smartphone-9.yml +9899 -0
  77. data/spec/fixtures/detector/smartphone.yml +5225 -4652
  78. data/spec/fixtures/detector/tablet-1.yml +4691 -4191
  79. data/spec/fixtures/detector/tablet-2.yml +9800 -71
  80. data/spec/fixtures/detector/tablet-3.yml +9959 -0
  81. data/spec/fixtures/detector/tablet-4.yml +4528 -0
  82. data/spec/fixtures/detector/tablet.yml +4664 -4177
  83. data/spec/fixtures/detector/tv.yml +3399 -1048
  84. data/spec/fixtures/detector/unknown.yml +1017 -977
  85. data/spec/fixtures/detector/wearable.yml +61 -0
  86. data/spec/fixtures/device/camera.yml +4 -3
  87. data/spec/fixtures/device/car_browser.yml +9 -2
  88. data/spec/fixtures/device/console.yml +15 -14
  89. data/spec/fixtures/parser/oss.yml +284 -2
  90. data/spec/fixtures/parser/vendorfragments.yml +8 -2
  91. metadata +50 -7
@@ -5,32 +5,54 @@
5
5
  name: Android
6
6
  short_name: AND
7
7
  version: "2.3.3"
8
- platform:
8
+ platform: ""
9
9
  client:
10
10
  type: browser
11
11
  name: Android Browser
12
12
  short_name: AN
13
- version:
13
+ version: ""
14
14
  engine: WebKit
15
+ engine_version: "533.1"
15
16
  device:
16
17
  type: camera
17
18
  brand: NN
18
19
  model: Coolpix S800c
19
20
  os_family: Android
20
21
  browser_family: Android Browser
22
+ -
23
+ user_agent: Mozilla/5.0 (Linux; Android 5.0.2; DMC-CM1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.92 Mobile Safari/537.36
24
+ os:
25
+ name: Android
26
+ short_name: AND
27
+ version: "5.0.2"
28
+ platform: ""
29
+ client:
30
+ type: browser
31
+ name: Chrome Mobile
32
+ short_name: CM
33
+ version: "77.0.3865.92"
34
+ engine: Blink
35
+ engine_version: ""
36
+ device:
37
+ type: camera
38
+ brand: PA
39
+ model: Lumix DMC-CM1
40
+ os_family: Android
41
+ browser_family: Chrome
21
42
  -
22
43
  user_agent: Mozilla/5.0 (Linux; U; Android 4.0; de-DE; EK-GC100 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
23
44
  os:
24
45
  name: Android
25
46
  short_name: AND
26
47
  version: "4.0"
27
- platform:
48
+ platform: ""
28
49
  client:
29
50
  type: browser
30
51
  name: Android Browser
31
52
  short_name: AN
32
- version:
53
+ version: ""
33
54
  engine: WebKit
55
+ engine_version: "534.30"
34
56
  device:
35
57
  type: camera
36
58
  brand: SA
@@ -43,13 +65,14 @@
43
65
  name: Android
44
66
  short_name: AND
45
67
  version: "4.1.2"
46
- platform:
68
+ platform: ""
47
69
  client:
48
70
  type: browser
49
71
  name: Opera Mobile
50
72
  short_name: OM
51
73
  version: "15.0.1162.60140"
52
74
  engine: Blink
75
+ engine_version: ""
53
76
  device:
54
77
  type: camera
55
78
  brand: SA
@@ -62,13 +85,14 @@
62
85
  name: Android
63
86
  short_name: AND
64
87
  version: "4.3"
65
- platform:
88
+ platform: ""
66
89
  client:
67
90
  type: browser
68
91
  name: Chrome Mobile
69
92
  short_name: CM
70
93
  version: "35.0.1916.141"
71
94
  engine: Blink
95
+ engine_version: ""
72
96
  device:
73
97
  type: camera
74
98
  brand: SA
@@ -81,13 +105,14 @@
81
105
  name: Android
82
106
  short_name: AND
83
107
  version: "4.1.2"
84
- platform:
108
+ platform: ""
85
109
  client:
86
110
  type: browser
87
111
  name: Chrome Mobile
88
112
  short_name: CM
89
113
  version: "18.0.1025.166"
90
114
  engine: WebKit
115
+ engine_version: "535.19"
91
116
  device:
92
117
  type: camera
93
118
  brand: SA
@@ -100,13 +125,14 @@
100
125
  name: Android
101
126
  short_name: AND
102
127
  version: "4.2.2"
103
- platform:
128
+ platform: ""
104
129
  client:
105
130
  type: browser
106
- name: Chrome Mobile
107
- short_name: CM
131
+ name: Chrome Webview
132
+ short_name: CV
108
133
  version: "18.0.1025.308"
109
134
  engine: WebKit
135
+ engine_version: "535.19"
110
136
  device:
111
137
  type: camera
112
138
  brand: SA
@@ -1,17 +1,78 @@
1
1
  ---
2
+ -
3
+ user_agent: Mozilla/5.0 (Linux; Android 4.4.2; CarPad-II-P Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
4
+ os:
5
+ name: Android
6
+ short_name: AND
7
+ version: "4.4.2"
8
+ platform: ""
9
+ client:
10
+ type: browser
11
+ name: Chrome Webview
12
+ short_name: CV
13
+ version: "30.0.0.0"
14
+ engine: Blink
15
+ engine_version: ""
16
+ device:
17
+ type: car browser
18
+ brand: NS
19
+ model: CarPad-II-P
20
+ os_family: Android
21
+ browser_family: Chrome
22
+ -
23
+ user_agent: Mozilla/5.0 (Linux; Android 4.4.2; CarPad-III-P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Safari/537.36
24
+ os:
25
+ name: Android
26
+ short_name: AND
27
+ version: "4.4.2"
28
+ platform: ""
29
+ client:
30
+ type: browser
31
+ name: Chrome
32
+ short_name: CH
33
+ version: "77.0.3865.116"
34
+ engine: Blink
35
+ engine_version: ""
36
+ device:
37
+ type: car browser
38
+ brand: NS
39
+ model: CarPad-III-P
40
+ os_family: Android
41
+ browser_family: Chrome
42
+ -
43
+ user_agent: Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/537.36 (KHTML, like Gecko) Chromium/75.0.3770.100 Chrome/75.0.3770.100 Safari/537.36 Tesla/2019.40.50.7-ad132c7b057e
44
+ os:
45
+ name: GNU/Linux
46
+ short_name: LIN
47
+ version: ""
48
+ platform: ""
49
+ client:
50
+ type: browser
51
+ name: Chromium
52
+ short_name: CR
53
+ version: "75.0.3770.100"
54
+ engine: Blink
55
+ engine_version: ""
56
+ device:
57
+ type: car browser
58
+ brand: TA
59
+ model: ""
60
+ os_family: GNU/Linux
61
+ browser_family: Chrome
2
62
  -
3
63
  user_agent: Mozilla/5.0 (X11; u; Linux; C) AppleWebKit /533.3 (Khtml, like Gheko) QtCarBrowser Safari/533.3
4
64
  os:
5
65
  name: GNU/Linux
6
66
  short_name: LIN
7
- version:
8
- platform:
67
+ version: ""
68
+ platform: ""
9
69
  client:
10
70
  type: browser
11
71
  name: Safari
12
72
  short_name: SF
13
- version:
73
+ version: ""
14
74
  engine: WebKit
75
+ engine_version: "533.3"
15
76
  device:
16
77
  type: car browser
17
78
  brand: TA
@@ -5,13 +5,14 @@
5
5
  name: Android
6
6
  short_name: AND
7
7
  version: "4.1.1"
8
- platform:
8
+ platform: ""
9
9
  client:
10
10
  type: browser
11
11
  name: Chrome
12
12
  short_name: CH
13
13
  version: "18.0.1025.166"
14
14
  engine: WebKit
15
+ engine_version: "535.19"
15
16
  device:
16
17
  type: console
17
18
  brand: AR
@@ -24,13 +25,14 @@
24
25
  name: Android
25
26
  short_name: AND
26
27
  version: "4.2.2"
27
- platform:
28
+ platform: ""
28
29
  client:
29
30
  type: browser
30
31
  name: Android Browser
31
32
  short_name: AN
32
- version:
33
+ version: ""
33
34
  engine: WebKit
35
+ engine_version: "534.30"
34
36
  device:
35
37
  type: console
36
38
  brand: AR
@@ -43,13 +45,14 @@
43
45
  name: Windows
44
46
  short_name: WIN
45
47
  version: "7"
46
- platform:
48
+ platform: ""
47
49
  client:
48
50
  type: browser
49
51
  name: Internet Explorer
50
52
  short_name: IE
51
53
  version: "9.0"
52
54
  engine: Trident
55
+ engine_version: "5.0"
53
56
  device:
54
57
  type: console
55
58
  brand: MS
@@ -62,13 +65,14 @@
62
65
  name: Windows
63
66
  short_name: WIN
64
67
  version: "8"
65
- platform:
68
+ platform: ""
66
69
  client:
67
70
  type: browser
68
71
  name: Internet Explorer
69
72
  short_name: IE
70
73
  version: "10.0"
71
74
  engine: Trident
75
+ engine_version: "6.0"
72
76
  device:
73
77
  type: console
74
78
  brand: MS
@@ -81,13 +85,14 @@
81
85
  name: Windows Phone
82
86
  short_name: WPH
83
87
  version: "8.0"
84
- platform:
88
+ platform: ""
85
89
  client:
86
90
  type: browser
87
91
  name: IE Mobile
88
92
  short_name: IM
89
93
  version: "10.0"
90
94
  engine: Trident
95
+ engine_version: "6.0"
91
96
  device:
92
97
  type: console
93
98
  brand: MS
@@ -100,13 +105,14 @@
100
105
  name: Nintendo Mobile
101
106
  short_name: NDS
102
107
  version: "3DS"
103
- platform:
108
+ platform: ""
104
109
  client:
105
110
  type: browser
106
111
  name: NetFront
107
112
  short_name: NF
108
- version:
109
- engine:
113
+ version: ""
114
+ engine: ""
115
+ engine_version: ""
110
116
  device:
111
117
  type: console
112
118
  brand: NI
@@ -119,32 +125,54 @@
119
125
  name: Nintendo Mobile
120
126
  short_name: NDS
121
127
  version: "DS"
122
- platform:
128
+ platform: ""
123
129
  client:
124
130
  type: browser
125
131
  name: Bunjalloo
126
132
  short_name: BJ
127
133
  version: "0.7.6"
128
- engine:
134
+ engine: ""
135
+ engine_version: ""
129
136
  device:
130
137
  type: console
131
138
  brand: NI
132
139
  model: DS
133
140
  os_family: Mobile Gaming Console
134
141
  browser_family: Unknown
142
+ -
143
+ user_agent: Mozilla/5.0 (Nintendo Switch; WifiWebAuthApplet) AppleWebKit/601.6 (KHTML, like Gecko) NF/4.0.0.7.9 NintendoBrowser/5.1.0.15785
144
+ os:
145
+ name: Nintendo
146
+ short_name: WII
147
+ version: "Switch"
148
+ platform: ""
149
+ client:
150
+ type: browser
151
+ name: NetFront
152
+ short_name: NF
153
+ version: ""
154
+ engine: WebKit
155
+ engine_version: "601.6"
156
+ device:
157
+ type: console
158
+ brand: NI
159
+ model: Switch
160
+ os_family: Gaming Console
161
+ browser_family: NetFront
135
162
  -
136
163
  user_agent: Opera/9.30 (Nintendo Wii; U; ; 3642; en)
137
164
  os:
138
165
  name: Nintendo
139
166
  short_name: WII
140
167
  version: "Wii"
141
- platform:
168
+ platform: ""
142
169
  client:
143
170
  type: browser
144
171
  name: Opera
145
172
  short_name: OP
146
173
  version: "9.30"
147
174
  engine: Presto
175
+ engine_version: ""
148
176
  device:
149
177
  type: console
150
178
  brand: NI
@@ -157,13 +185,14 @@
157
185
  name: Nintendo
158
186
  short_name: WII
159
187
  version: "Wii"
160
- platform:
188
+ platform: ""
161
189
  client:
162
190
  type: browser
163
191
  name: NetFront
164
192
  short_name: NF
165
- version:
193
+ version: ""
166
194
  engine: WebKit
195
+ engine_version: "534.52"
167
196
  device:
168
197
  type: console
169
198
  brand: NI
@@ -176,13 +205,14 @@
176
205
  name: Android
177
206
  short_name: AND
178
207
  version: "4.1.2"
179
- platform:
208
+ platform: ""
180
209
  client:
181
210
  type: browser
182
211
  name: Android Browser
183
212
  short_name: AN
184
- version:
213
+ version: ""
185
214
  engine: WebKit
215
+ engine_version: "534.30"
186
216
  device:
187
217
  type: console
188
218
  brand: OU
@@ -195,13 +225,14 @@
195
225
  name: PlayStation
196
226
  short_name: PS3
197
227
  version: "3"
198
- platform:
228
+ platform: ""
199
229
  client:
200
230
  type: browser
201
231
  name: NetFront
202
232
  short_name: NF
203
- version:
233
+ version: ""
204
234
  engine: WebKit
235
+ engine_version: "531.22.8"
205
236
  device:
206
237
  type: console
207
238
  brand: SO
@@ -214,32 +245,54 @@
214
245
  name: PlayStation
215
246
  short_name: PS3
216
247
  version: "4"
217
- platform:
248
+ platform: ""
218
249
  client:
219
250
  type: browser
220
251
  name: NetFront
221
252
  short_name: NF
222
- version:
253
+ version: ""
223
254
  engine: WebKit
255
+ engine_version: "536.26"
224
256
  device:
225
257
  type: console
226
258
  brand: SO
227
259
  model: PlayStation 4
228
260
  os_family: Gaming Console
229
261
  browser_family: NetFront
262
+ -
263
+ user_agent: Mozilla/5.0 (PlayStation 4 Pro 5.0)
264
+ os:
265
+ name: PlayStation
266
+ short_name: PS3
267
+ version: "4"
268
+ platform: ""
269
+ client:
270
+ type: browser
271
+ name: NetFront
272
+ short_name: NF
273
+ version: ""
274
+ engine: ""
275
+ engine_version: ""
276
+ device:
277
+ type: console
278
+ brand: SO
279
+ model: PlayStation 4 Pro
280
+ os_family: Gaming Console
281
+ browser_family: NetFront
230
282
  -
231
283
  user_agent: Mozilla/4.0 (PlayStation Portable); 2.00)
232
284
  os:
233
285
  name: PlayStation Portable
234
286
  short_name: PSP
235
287
  version: "Portable"
236
- platform:
288
+ platform: ""
237
289
  client:
238
290
  type: browser
239
291
  name: NetFront
240
292
  short_name: NF
241
- version:
242
- engine:
293
+ version: ""
294
+ engine: ""
295
+ engine_version: ""
243
296
  device:
244
297
  type: console
245
298
  brand: SO
@@ -252,16 +305,17 @@
252
305
  name: PlayStation Portable
253
306
  short_name: PSP
254
307
  version: "Vita"
255
- platform:
308
+ platform: ""
256
309
  client:
257
310
  type: browser
258
311
  name: Mobile Silk
259
312
  short_name: MS
260
313
  version: "3.2"
261
- engine: Blink
314
+ engine: WebKit
315
+ engine_version: "536.26"
262
316
  device:
263
317
  type: console
264
318
  brand: SO
265
319
  model: PlayStation Vita
266
320
  os_family: Mobile Gaming Console
267
- browser_family: Unknown
321
+ browser_family: Chrome