device_detector 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -0
  3. data/Rakefile +12 -6
  4. data/device_detector.gemspec +1 -1
  5. data/lib/device_detector.rb +65 -4
  6. data/lib/device_detector/client.rb +6 -6
  7. data/lib/device_detector/device.rb +62 -31
  8. data/lib/device_detector/memory_cache.rb +1 -1
  9. data/lib/device_detector/metadata_extractor.rb +4 -13
  10. data/lib/device_detector/model_extractor.rb +10 -1
  11. data/lib/device_detector/name_extractor.rb +1 -1
  12. data/lib/device_detector/os.rb +141 -5
  13. data/lib/device_detector/parser.rb +23 -12
  14. data/lib/device_detector/version.rb +1 -1
  15. data/lib/device_detector/version_extractor.rb +1 -1
  16. data/regexes/bots.yml +36 -1
  17. data/regexes/{browser_engines.yml → client/browser_engine.yml} +4 -1
  18. data/regexes/{browsers.yml → client/browsers.yml} +31 -27
  19. data/regexes/{feed_readers.yml → client/feed_readers.yml} +0 -1
  20. data/regexes/{libraries.yml → client/libraries.yml} +1 -1
  21. data/regexes/{mediaplayers.yml → client/mediaplayers.yml} +1 -1
  22. data/regexes/{mobile_apps.yml → client/mobile_apps.yml} +0 -1
  23. data/regexes/{pim.yml → client/pim.yml} +1 -1
  24. data/regexes/{devices → device}/cameras.yml +1 -1
  25. data/regexes/{devices → device}/car_browsers.yml +0 -1
  26. data/regexes/{devices → device}/consoles.yml +0 -1
  27. data/regexes/{devices → device}/mobiles.yml +193 -49
  28. data/regexes/{devices/portable_media_players.yml → device/portable_media_player.yml} +0 -1
  29. data/regexes/{devices → device}/televisions.yml +0 -3
  30. data/regexes/oss.yml +105 -102
  31. data/regexes/vendorfragments.yml +70 -0
  32. data/spec/device_detector/bot_fixtures_spec.rb +30 -0
  33. data/spec/device_detector/client_fixtures_spec.rb +31 -0
  34. data/spec/device_detector/concrete_user_agent_spec.rb +41 -1
  35. data/spec/device_detector/detector_fixtures_spec.rb +56 -0
  36. data/spec/device_detector/device_fixtures_spec.rb +36 -0
  37. data/spec/device_detector/device_spec.rb +3 -3
  38. data/spec/device_detector/memory_cache_spec.rb +1 -1
  39. data/spec/device_detector/model_extractor_spec.rb +7 -7
  40. data/spec/device_detector/os_fixtures_spec.rb +26 -0
  41. data/spec/device_detector/version_extractor_spec.rb +10 -10
  42. data/spec/device_detector_spec.rb +1 -1
  43. data/spec/fixtures/client/browser.yml +986 -0
  44. data/spec/fixtures/client/feed_reader.yml +180 -0
  45. data/spec/fixtures/client/library.yml +78 -0
  46. data/spec/fixtures/client/mediaplayer.yml +144 -0
  47. data/spec/fixtures/client/mobile_app.yml +24 -0
  48. data/spec/fixtures/client/pim.yml +90 -0
  49. data/spec/fixtures/detector/bots.yml +716 -0
  50. data/spec/fixtures/detector/camera.yml +91 -0
  51. data/spec/fixtures/detector/car_browser.yml +19 -0
  52. data/spec/fixtures/detector/console.yml +253 -0
  53. data/spec/fixtures/detector/desktop.yml +4568 -0
  54. data/spec/fixtures/detector/feature_phone.yml +719 -0
  55. data/spec/fixtures/detector/feed_reader.yml +462 -0
  56. data/spec/fixtures/detector/mediaplayer.yml +141 -0
  57. data/spec/fixtures/detector/mobile_apps.yml +32 -0
  58. data/spec/fixtures/detector/phablet.yml +1095 -0
  59. data/spec/fixtures/detector/portable_media_player.yml +145 -0
  60. data/spec/fixtures/detector/smart_display.yml +19 -0
  61. data/spec/fixtures/detector/smartphone.yml +28673 -0
  62. data/spec/fixtures/detector/tablet.yml +13201 -0
  63. data/spec/fixtures/detector/tv.yml +1380 -0
  64. data/spec/fixtures/detector/unknown.yml +3536 -0
  65. data/spec/fixtures/device/camera.yml +18 -0
  66. data/spec/fixtures/device/car_browser.yml +6 -0
  67. data/spec/fixtures/device/console.yml +72 -0
  68. data/spec/fixtures/parser/bots.yml +2055 -0
  69. data/spec/fixtures/parser/oss.yml +607 -0
  70. data/spec/fixtures/parser/vendorfragments.yml +156 -0
  71. data/spec/spec_helper.rb +6 -2
  72. metadata +84 -17
@@ -59,4 +59,3 @@ Samsung:
59
59
  model: 'Galaxy Player 50'
60
60
  - regex: 'YP-GB70D'
61
61
  model: 'Galaxy Player 70 Plus'
62
-
@@ -73,8 +73,6 @@ LG:
73
73
  models:
74
74
  - regex: '(NetCast [0-9]{1}.[0-9]{1}|GLOBAL_PLAT3)'
75
75
  model: '$1'
76
- - regex: 'LGE_DLNA_SDK|NetCast'
77
- model: 'NetCast'
78
76
 
79
77
  # Loewe
80
78
  Loewe:
@@ -240,4 +238,3 @@ Videoweb:
240
238
  model: '$1'
241
239
  - regex: 'ANTGalio/3.0'
242
240
  model: '600S'
243
-
@@ -34,8 +34,8 @@
34
34
  - regex: 'Windows Phone (?:OS)?[ ]?(\d+[\.\d]+)'
35
35
  name: 'Windows Phone'
36
36
  version: '$1'
37
-
38
-
37
+
38
+
39
39
  - regex: 'XBLWP7|Windows Phone'
40
40
  name: 'Windows Phone'
41
41
  version: ''
@@ -43,21 +43,21 @@
43
43
  - regex: 'Windows CE'
44
44
  name: 'Windows CE'
45
45
  version: ''
46
-
47
-
46
+
47
+
48
48
  - regex: '(?:IEMobile|Windows Mobile)(?: (\d+[\.\d]+))?'
49
49
  name: 'Windows Mobile'
50
50
  version: '$1'
51
-
52
-
51
+
52
+
53
53
  - regex: 'Windows NT 6.2; ARM;'
54
54
  name: 'Windows RT'
55
55
  version: ''
56
-
56
+
57
57
  - regex: 'Windows NT 6.3; ARM;'
58
58
  name: 'Windows RT'
59
59
  version: '8.1'
60
-
60
+
61
61
 
62
62
  ##########
63
63
  # Custom Android Roms
@@ -84,13 +84,13 @@
84
84
  - regex: '(?:Android|Adr)[ /](?:[a-z]+ )?(\d+[\.\d]+)'
85
85
  name: 'Android'
86
86
  version: '$1'
87
-
88
-
87
+
88
+
89
89
  - regex: 'Android|Silk-Accelerated=[a-z]{4,5}'
90
90
  name: 'Android'
91
91
  version: ''
92
-
93
-
92
+
93
+
94
94
  ##########
95
95
  # AmigaOS
96
96
  ##########
@@ -140,7 +140,11 @@
140
140
  version: '$1'
141
141
 
142
142
 
143
+ - regex: 'MorphOS(?:[ /](\d+[\.\d]+))?'
144
+ name: 'MorphOS'
145
+ version: '$1'
143
146
 
147
+
144
148
  ##########
145
149
  # Windows
146
150
  ##########
@@ -151,7 +155,7 @@
151
155
  - regex: 'CYGWIN_NT-6.4|Windows NT 6.4|Windows 10'
152
156
  name: 'Windows'
153
157
  version: '10'
154
-
158
+
155
159
  - regex: 'CYGWIN_NT-6.3|Windows NT 6.3|Windows 8.1'
156
160
  name: 'Windows'
157
161
  version: '8.1'
@@ -160,64 +164,64 @@
160
164
  - regex: 'CYGWIN_NT-6.2|Windows NT 6.2|Windows 8'
161
165
  name: 'Windows'
162
166
  version: '8'
163
-
164
-
167
+
168
+
165
169
  - regex: 'CYGWIN_NT-6.1|Windows NT 6.1|Windows 7'
166
170
  name: 'Windows'
167
171
  version: '7'
168
-
169
-
172
+
173
+
170
174
  - regex: 'CYGWIN_NT-6.0|Windows NT 6.0|Windows Vista'
171
175
  name: 'Windows'
172
176
  version: 'Vista'
173
-
174
-
177
+
178
+
175
179
  - regex: 'CYGWIN_NT-5.2|Windows NT 5.2|Windows Server 2003 / XP x64'
176
180
  name: 'Windows'
177
181
  version: 'Server 2003'
178
-
179
-
182
+
183
+
180
184
  - regex: 'CYGWIN_NT-5.1|Windows NT 5.1|Windows XP'
181
185
  name: 'Windows'
182
186
  version: 'XP'
183
-
184
-
187
+
188
+
185
189
  - regex: 'CYGWIN_NT-5.0|Windows NT 5.0|Windows 2000'
186
190
  name: 'Windows'
187
191
  version: '2000'
188
-
189
-
192
+
193
+
190
194
  - regex: 'CYGWIN_NT-4.0|Windows NT 4.0|WinNT|Windows NT'
191
195
  name: 'Windows'
192
196
  version: 'NT'
193
-
194
-
197
+
198
+
195
199
  - regex: 'CYGWIN_ME-4.90|Win 9x 4.90|Windows ME'
196
200
  name: 'Windows'
197
201
  version: 'ME'
198
-
199
-
202
+
203
+
200
204
  - regex: 'CYGWIN_98-4.10|Win98|Windows 98'
201
205
  name: 'Windows'
202
206
  version: '98'
203
-
204
-
207
+
208
+
205
209
  - regex: 'CYGWIN_95-4.0|Win32|Win95|Windows 95|Windows_95'
206
210
  name: 'Windows'
207
211
  version: '95'
208
-
209
-
212
+
213
+
210
214
  - regex: 'Windows 3.1'
211
215
  name: 'Windows'
212
216
  version: '3.1'
213
-
214
-
217
+
218
+
215
219
  - regex: 'Windows'
216
220
  name: 'Windows'
217
221
  version: ''
218
-
219
-
220
-
222
+
223
+
224
+
221
225
  ##########
222
226
  # iOS
223
227
  ##########
@@ -237,7 +241,7 @@
237
241
  - regex: 'Mac OS X(?: (?:Version )?(\d+(?:[_\.]\d+)+))?'
238
242
  name: 'Mac'
239
243
  version: '$1'
240
-
244
+
241
245
  - regex: 'Mac (\d+(?:[_\.]\d+)+)'
242
246
  name: 'Mac'
243
247
  version: '$1'
@@ -245,36 +249,36 @@
245
249
  - regex: 'Darwin|Macintosh|Mac_PowerPC|PPC|Mac PowerPC'
246
250
  name: 'Mac'
247
251
  version: ''
248
-
249
-
250
-
252
+
253
+
254
+
251
255
  ##########
252
256
  # ChromeOS
253
257
  ##########
254
258
  - regex: 'CrOS [a-z0-9_]+ (\d+[\.\d]+)'
255
259
  name: 'Chrome OS'
256
260
  version: '$1'
257
-
258
-
259
-
261
+
262
+
263
+
260
264
  ##########
261
265
  # BlackBerry
262
266
  ##########
263
267
  - regex: '(?:BB10;.+Version|Black[Bb]erry[0-9a-z]+|Black[Bb]erry.+Version)/(\d+[\.\d]+)'
264
268
  name: 'BlackBerry OS'
265
269
  version: '$1'
266
-
267
-
270
+
271
+
268
272
  - regex: 'RIM Tablet OS (\d+[\.\d]+)'
269
273
  name: 'BlackBerry Tablet OS'
270
274
  version: '$1'
271
-
272
-
275
+
276
+
273
277
  - regex: 'RIM Tablet OS|QNX|Play[Bb]ook'
274
278
  name: 'BlackBerry Tablet OS'
275
279
  version: ''
276
-
277
-
280
+
281
+
278
282
  - regex: 'BlackBerry'
279
283
  name: 'BlackBerry OS'
280
284
  version: ''
@@ -329,18 +333,18 @@
329
333
  - regex: 'SymbianOS/(\d+[\.\d]+)'
330
334
  name: 'Symbian OS'
331
335
  version: '$1'
332
-
333
-
336
+
337
+
334
338
  - regex: 'MeeGo|WeTab'
335
339
  name: 'MeeGo'
336
340
  version: ''
337
-
338
-
341
+
342
+
339
343
  - regex: 'Symbian OS|SymbOS'
340
344
  name: 'Symbian OS'
341
345
  version: ''
342
-
343
-
346
+
347
+
344
348
  - regex: 'Nokia'
345
349
  name: 'Symbian'
346
350
  version: ''
@@ -377,8 +381,8 @@
377
381
  - regex: 'bada(?:[ /](\d+[\.\d]+))'
378
382
  name: 'Bada'
379
383
  version: '$1'
380
-
381
-
384
+
385
+
382
386
  - regex: 'bada'
383
387
  name: 'Bada'
384
388
  version: ''
@@ -396,120 +400,120 @@
396
400
  name: 'Brew'
397
401
  version: ''
398
402
 
399
-
403
+
400
404
  ##########
401
405
  # Web TV
402
406
  ##########
403
407
  - regex: 'GoogleTV(?:[ /](\d+[\.\d]+))?'
404
408
  name: 'Google TV'
405
409
  version: '$1'
406
-
407
-
410
+
411
+
408
412
  - regex: 'AppleTV(?:/?(\d+[\.\d]+))?'
409
413
  name: 'Apple TV'
410
414
  version: '$1'
411
-
412
-
415
+
416
+
413
417
  - regex: 'WebTV/(\d+[\.\d]+)'
414
418
  name: 'WebTV'
415
419
  version: '$1'
416
-
417
-
418
-
420
+
421
+
422
+
419
423
  ##########
420
424
  # Unix
421
425
  ##########
422
426
  - regex: '(?:SunOS|Solaris)(?:[/ ](\d+[\.\d]+))?'
423
427
  name: 'Solaris'
424
428
  version: '$1'
425
-
426
-
429
+
430
+
427
431
  - regex: 'AIX(?:[/ ]?(\d+[\.\d]+))?'
428
432
  name: 'AIX'
429
433
  version: '$1'
430
-
431
-
434
+
435
+
432
436
  - regex: 'HP-UX(?:[/ ]?(\d+[\.\d]+))?'
433
437
  name: 'HP-UX'
434
438
  version: '$1'
435
-
436
-
439
+
440
+
437
441
  - regex: 'FreeBSD(?:[/ ]?(\d+[\.\d]+))?'
438
442
  name: 'FreeBSD'
439
443
  version: '$1'
440
-
441
-
444
+
445
+
442
446
  - regex: 'NetBSD(?:[/ ]?(\d+[\.\d]+))?'
443
447
  name: 'NetBSD'
444
448
  version: '$1'
445
-
446
-
449
+
450
+
447
451
  - regex: 'OpenBSD(?:[/ ]?(\d+[\.\d]+))?'
448
452
  name: 'OpenBSD'
449
453
  version: '$1'
450
-
451
-
454
+
455
+
452
456
  - regex: 'DragonFly(?:[/ ]?(\d+[\.\d]+))?'
453
457
  name: 'DragonFly'
454
458
  version: '$1'
455
-
456
-
459
+
460
+
457
461
  - regex: 'Syllable(?:[/ ]?(\d+[\.\d]+))?'
458
462
  name: 'Syllable'
459
463
  version: '$1'
460
-
461
-
464
+
465
+
462
466
  - regex: 'IRIX(?:[/ ]?(\d+[\.\d]+))'
463
467
  name: 'IRIX'
464
468
  version: '$1'
465
-
466
-
469
+
470
+
467
471
  - regex: 'OSF1(?:[/ ]?v?(\d+[\.\d]+))?'
468
472
  name: 'OSF1'
469
473
  version: '$1'
470
-
471
-
472
-
474
+
475
+
476
+
473
477
  ##########
474
478
  # Gaming Console
475
479
  ##########
476
480
  - regex: 'Nintendo Wii'
477
481
  name: 'Nintendo'
478
482
  version: 'Wii'
479
-
480
-
483
+
484
+
481
485
  - regex: 'PlayStation ?([3|4])'
482
486
  name: 'PlayStation'
483
487
  version: '$1'
484
-
485
-
488
+
489
+
486
490
  - regex: 'Xbox|KIN\.(?:One|Two)'
487
491
  name: 'Xbox'
488
492
  version: '360'
489
-
490
-
491
-
493
+
494
+
495
+
492
496
  ##########
493
497
  # Mobile Gaming Console
494
498
  ##########
495
499
  - regex: 'Nitro|Nintendo ([3]?DS[i]?)'
496
500
  name: 'Nintendo Mobile'
497
501
  version: '$1'
498
-
499
-
502
+
503
+
500
504
  - regex: 'PlayStation ((?:Portable|Vita))'
501
505
  name: 'PlayStation Portable'
502
506
  version: '$1'
503
-
504
-
505
-
507
+
508
+
509
+
506
510
  ##########
507
511
  # IBM
508
512
  ##########
509
513
  - regex: 'OS/2'
510
514
  name: 'OS/2'
511
515
  version: ''
512
-
516
+
513
517
 
514
518
 
515
519
  ###########
@@ -520,4 +524,3 @@
520
524
  version: ''
521
525
 
522
526
 
523
-
@@ -0,0 +1,70 @@
1
+ ###############
2
+ # Device Detector - The Universal Device Detection library for parsing User Agents
3
+ #
4
+ # @link http://piwik.org
5
+ # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
+ ###############
7
+
8
+ Dell:
9
+ - 'MDDR(JS)?'
10
+ - 'MDDC(JS)?'
11
+ - 'MDDS(JS)?'
12
+
13
+ Acer:
14
+ - 'MAAR(JS)?'
15
+
16
+ Sony:
17
+ - 'MASE(JS)?'
18
+ - 'MASP(JS)?'
19
+ - 'MASA(JS)?'
20
+
21
+ Asus:
22
+ - 'MAAU'
23
+ - 'NP0[6789]'
24
+ - 'ASJB'
25
+ - 'ASU2(JS)?'
26
+
27
+ Samsung:
28
+ - 'MASM(JS)?'
29
+ - 'SMJB'
30
+
31
+ Lenovo:
32
+ - 'MALC(JS)?'
33
+ - 'MALE(JS)?'
34
+ - 'MALN(JS)?'
35
+ - 'LCJB'
36
+ - 'LEN2'
37
+
38
+ Toshiba:
39
+ - 'MATM(JS)?'
40
+ - 'MATB(JS)?'
41
+ - 'MATP(JS)?'
42
+ - 'TNJB'
43
+ - 'TAJB'
44
+
45
+ Medion:
46
+ - 'MAMD'
47
+
48
+ MSI:
49
+ - 'MAMI(JS)?'
50
+ - 'MAM3'
51
+
52
+ Gateway:
53
+ - 'MAGW(JS)?'
54
+
55
+ Fujitsu:
56
+ - 'MAFS(JS)?'
57
+ - 'FSJB'
58
+
59
+ Compaq:
60
+ - 'CPDTDF'
61
+ - 'CPNTDF(JS?)'
62
+ - 'CMNTDF(JS)?'
63
+
64
+ HP:
65
+ - 'HPCMHP'
66
+ - 'HPNTDF(JS)?'
67
+ - 'HPDTDF(JS)?'
68
+
69
+ Hyrican:
70
+ - 'MANM(JS)?'