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
@@ -6,8 +6,9 @@
6
6
  type: browser
7
7
  name: Obigo
8
8
  short_name: OB
9
- version:
10
- engine:
9
+ version: ""
10
+ engine: ""
11
+ engine_version: ""
11
12
  device:
12
13
  type: feature phone
13
14
  brand: AI
@@ -22,7 +23,8 @@
22
23
  name: Openwave Mobile Browser
23
24
  short_name: OV
24
25
  version: "6.3.0.4"
25
- engine:
26
+ engine: ""
27
+ engine_version: ""
26
28
  device:
27
29
  type: feature phone
28
30
  brand: BQ
@@ -37,7 +39,8 @@
37
39
  name: Openwave Mobile Browser
38
40
  short_name: OV
39
41
  version: "6.3.0.7"
40
- engine:
42
+ engine: ""
43
+ engine_version: ""
41
44
  device:
42
45
  type: feature phone
43
46
  brand: CK
@@ -93,7 +96,7 @@
93
96
  device:
94
97
  type: feature phone
95
98
  brand: GI
96
- model: 50
99
+ model: "50"
97
100
  os_family: Unknown
98
101
  browser_family: Unknown
99
102
  -
@@ -144,7 +147,8 @@
144
147
  name: Openwave Mobile Browser
145
148
  short_name: OV
146
149
  version: "6.2"
147
- engine:
150
+ engine: ""
151
+ engine_version: ""
148
152
  device:
149
153
  type: feature phone
150
154
  brand: KD
@@ -156,14 +160,15 @@
156
160
  os:
157
161
  name: Brew
158
162
  short_name: BMP
159
- version:
160
- platform:
163
+ version: ""
164
+ platform: ""
161
165
  client:
162
166
  type: browser
163
167
  name: Opera Mobile
164
168
  short_name: OM
165
169
  version: "10.00"
166
170
  engine: Presto
171
+ engine_version: "2.4.18"
167
172
  device:
168
173
  type: feature phone
169
174
  brand: KD
@@ -178,7 +183,8 @@
178
183
  name: Openwave Mobile Browser
179
184
  short_name: OV
180
185
  version: "6.2"
181
- engine:
186
+ engine: ""
187
+ engine_version: ""
182
188
  device:
183
189
  type: feature phone
184
190
  brand: KD
@@ -193,7 +199,8 @@
193
199
  name: Openwave Mobile Browser
194
200
  short_name: OV
195
201
  version: "6.2"
196
- engine:
202
+ engine: ""
203
+ engine_version: ""
197
204
  device:
198
205
  type: feature phone
199
206
  brand: KD
@@ -206,19 +213,52 @@
206
213
  name: Brew
207
214
  short_name: BMP
208
215
  version: "1.0.4"
209
- platform:
216
+ platform: ""
210
217
  client:
211
218
  type: browser
212
219
  name: NetFront
213
220
  short_name: NF
214
221
  version: "4.1"
215
222
  engine: NetFront
223
+ engine_version: "4.1"
216
224
  device:
217
225
  type: feature phone
218
226
  brand: KY
219
227
  model: Coast
220
228
  os_family: Brew
221
229
  browser_family: NetFront
230
+ -
231
+ user_agent: lephone K10/Dorado WAP-Browser/1.0.0
232
+ os: [ ]
233
+ client:
234
+ type: browser
235
+ name: Dorado
236
+ short_name: DO
237
+ version: "1.0.0"
238
+ engine: ""
239
+ engine_version: ""
240
+ device:
241
+ type: feature phone
242
+ brand: L7
243
+ model: K10
244
+ os_family: Unknown
245
+ browser_family: Nokia Browser
246
+ -
247
+ user_agent: lephone K7/Dorado WAP-Browser/1.0.0
248
+ os: [ ]
249
+ client:
250
+ type: browser
251
+ name: Dorado
252
+ short_name: DO
253
+ version: "1.0.0"
254
+ engine: ""
255
+ engine_version: ""
256
+ device:
257
+ type: feature phone
258
+ brand: L7
259
+ model: K7
260
+ os_family: Unknown
261
+ browser_family: Nokia Browser
222
262
  -
223
263
  user_agent: MOT-V360v/08.B7.58R MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
224
264
  os: [ ]
@@ -234,20 +274,41 @@
234
274
  os:
235
275
  name: Windows CE
236
276
  short_name: WCE
237
- version:
238
- platform:
277
+ version: ""
278
+ platform: ""
239
279
  client:
240
280
  type: browser
241
281
  name: IE Mobile
242
282
  short_name: IM
243
283
  version: "6.12"
244
284
  engine: Trident
285
+ engine_version: ""
245
286
  device:
246
287
  type: feature phone
247
288
  brand: MS
248
289
  model: Kin Two
249
290
  os_family: Windows Mobile
250
291
  browser_family: Internet Explorer
292
+ -
293
+ user_agent: 'Mozilla/5.0 (Sonim-XP3400/E343B_2100B00_N1900;U;REX/1.0;BREW/3.1.5;240*320;CTC/2.0) POLARIS/6.2'
294
+ os:
295
+ name: Brew
296
+ short_name: BMP
297
+ version: "3.1.5"
298
+ platform: ""
299
+ client:
300
+ type: browser
301
+ name: Polaris
302
+ short_name: PO
303
+ version: "6.2"
304
+ engine: ""
305
+ engine_version: ""
306
+ device:
307
+ type: feature phone
308
+ brand: OI
309
+ model: XP3400
310
+ os_family: Brew
311
+ browser_family: Unknown
251
312
  -
252
313
  user_agent: Mozilla/4.0 (jig browser 7.3.7; P902i)
253
314
  os: [ ]
@@ -256,7 +317,8 @@
256
317
  name: Jig Browser
257
318
  short_name: JI
258
319
  version: "7.3.7"
259
- engine:
320
+ engine: ""
321
+ engine_version: ""
260
322
  device:
261
323
  type: feature phone
262
324
  brand: PA
@@ -272,6 +334,7 @@
272
334
  short_name: NF
273
335
  version: "3.5"
274
336
  engine: NetFront
337
+ engine_version: "3.5"
275
338
  device:
276
339
  type: feature phone
277
340
  brand: SA
@@ -287,6 +350,7 @@
287
350
  short_name: NF
288
351
  version: "3.5"
289
352
  engine: NetFront
353
+ engine_version: "3.5"
290
354
  device:
291
355
  type: feature phone
292
356
  brand: SE
@@ -302,6 +366,7 @@
302
366
  short_name: NF
303
367
  version: "3.5"
304
368
  engine: NetFront
369
+ engine_version: "3.5"
305
370
  device:
306
371
  type: feature phone
307
372
  brand: SE
@@ -317,6 +382,7 @@
317
382
  short_name: NF
318
383
  version: "3.5"
319
384
  engine: NetFront
385
+ engine_version: "3.5"
320
386
  device:
321
387
  type: feature phone
322
388
  brand: SE
@@ -332,6 +398,7 @@
332
398
  short_name: NF
333
399
  version: "3.5"
334
400
  engine: NetFront
401
+ engine_version: "3.5"
335
402
  device:
336
403
  type: feature phone
337
404
  brand: SE
@@ -347,6 +414,7 @@
347
414
  short_name: NF
348
415
  version: "3.5"
349
416
  engine: NetFront
417
+ engine_version: "3.5"
350
418
  device:
351
419
  type: feature phone
352
420
  brand: SE
@@ -362,6 +430,7 @@
362
430
  short_name: NF
363
431
  version: "3.4"
364
432
  engine: NetFront
433
+ engine_version: "3.4"
365
434
  device:
366
435
  type: feature phone
367
436
  brand: SE
@@ -375,8 +444,9 @@
375
444
  type: browser
376
445
  name: Obigo
377
446
  short_name: OB
378
- version:
379
- engine:
447
+ version: ""
448
+ engine: ""
449
+ engine_version: ""
380
450
  device:
381
451
  type: feature phone
382
452
  brand: SE
@@ -391,7 +461,8 @@
391
461
  name: UC Browser
392
462
  short_name: UC
393
463
  version: "9.2.0.311"
394
- engine:
464
+ engine: ""
465
+ engine_version: ""
395
466
  device:
396
467
  type: feature phone
397
468
  brand: SE
@@ -407,6 +478,7 @@
407
478
  short_name: NF
408
479
  version: "3.4"
409
480
  engine: NetFront
481
+ engine_version: "3.4"
410
482
  device:
411
483
  type: feature phone
412
484
  brand: SE
@@ -418,14 +490,15 @@
418
490
  os:
419
491
  name: Symbian^3
420
492
  short_name: SY3
421
- version:
422
- platform:
493
+ version: ""
494
+ platform: ""
423
495
  client:
424
496
  type: browser
425
497
  name: SEMC-Browser
426
498
  short_name: SC
427
- version:
428
- engine:
499
+ version: ""
500
+ engine: ""
501
+ engine_version: ""
429
502
  device:
430
503
  type: feature phone
431
504
  brand: SE
@@ -438,13 +511,14 @@
438
511
  name: Symbian OS Series 60
439
512
  short_name: S60
440
513
  version: "5.0"
441
- platform:
514
+ platform: ""
442
515
  client:
443
516
  type: browser
444
517
  name: Nokia Browser
445
518
  short_name: NB
446
519
  version: "7.0"
447
520
  engine: WebKit
521
+ engine_version: "525"
448
522
  device:
449
523
  type: feature phone
450
524
  brand: SE
@@ -457,13 +531,14 @@
457
531
  name: Symbian OS Series 60
458
532
  short_name: S60
459
533
  version: "5.0"
460
- platform:
534
+ platform: ""
461
535
  client:
462
536
  type: browser
463
537
  name: Nokia Browser
464
538
  short_name: NB
465
539
  version: "7.0"
466
540
  engine: WebKit
541
+ engine_version: "525"
467
542
  device:
468
543
  type: feature phone
469
544
  brand: SE
@@ -487,8 +562,9 @@
487
562
  type: browser
488
563
  name: Obigo
489
564
  short_name: OB
490
- version:
491
- engine:
565
+ version: ""
566
+ engine: ""
567
+ engine_version: ""
492
568
  device:
493
569
  type: feature phone
494
570
  brand: SE
@@ -502,8 +578,9 @@
502
578
  type: browser
503
579
  name: Obigo
504
580
  short_name: OB
505
- version:
506
- engine:
581
+ version: ""
582
+ engine: ""
583
+ engine_version: ""
507
584
  device:
508
585
  type: feature phone
509
586
  brand: SE
@@ -518,7 +595,8 @@
518
595
  name: UC Browser
519
596
  short_name: UC
520
597
  version: "9.4.0.342"
521
- engine:
598
+ engine: ""
599
+ engine_version: ""
522
600
  device:
523
601
  type: feature phone
524
602
  brand: SE
@@ -531,13 +609,14 @@
531
609
  name: Symbian OS Series 60
532
610
  short_name: S60
533
611
  version: "5.0"
534
- platform:
612
+ platform: ""
535
613
  client:
536
614
  type: browser
537
615
  name: Nokia Browser
538
616
  short_name: NB
539
617
  version: "7.0"
540
618
  engine: WebKit
619
+ engine_version: "525"
541
620
  device:
542
621
  type: feature phone
543
622
  brand: SE
@@ -550,13 +629,14 @@
550
629
  name: Symbian OS Series 60
551
630
  short_name: S60
552
631
  version: "5.0"
553
- platform:
632
+ platform: ""
554
633
  client:
555
634
  type: browser
556
635
  name: Nokia Browser
557
636
  short_name: NB
558
637
  version: "7.0"
559
638
  engine: WebKit
639
+ engine_version: "525"
560
640
  device:
561
641
  type: feature phone
562
642
  brand: SE
@@ -570,8 +650,9 @@
570
650
  type: browser
571
651
  name: Obigo
572
652
  short_name: OB
573
- version:
574
- engine:
653
+ version: ""
654
+ engine: ""
655
+ engine_version: ""
575
656
  device:
576
657
  type: feature phone
577
658
  brand: SE
@@ -587,6 +668,7 @@
587
668
  short_name: NF
588
669
  version: "3.5"
589
670
  engine: NetFront
671
+ engine_version: "3.5"
590
672
  device:
591
673
  type: feature phone
592
674
  brand: SE
@@ -601,7 +683,8 @@
601
683
  name: Openwave Mobile Browser
602
684
  short_name: OV
603
685
  version: "7.2.6"
604
- engine:
686
+ engine: ""
687
+ engine_version: ""
605
688
  device:
606
689
  type: feature phone
607
690
  brand: SG
@@ -616,7 +699,8 @@
616
699
  name: Openwave Mobile Browser
617
700
  short_name: OV
618
701
  version: "7.2.6"
619
- engine:
702
+ engine: ""
703
+ engine_version: ""
620
704
  device:
621
705
  type: feature phone
622
706
  brand: SG
@@ -631,7 +715,8 @@
631
715
  name: Openwave Mobile Browser
632
716
  short_name: OV
633
717
  version: "7.2.6"
634
- engine:
718
+ engine: ""
719
+ engine_version: ""
635
720
  device:
636
721
  type: feature phone
637
722
  brand: SG
@@ -646,7 +731,8 @@
646
731
  name: Openwave Mobile Browser
647
732
  short_name: OV
648
733
  version: "6.2.3.3"
649
- engine:
734
+ engine: ""
735
+ engine_version: ""
650
736
  device:
651
737
  type: feature phone
652
738
  brand: SG
@@ -661,7 +747,8 @@
661
747
  name: Openwave Mobile Browser
662
748
  short_name: OV
663
749
  version: "6.2.2.6"
664
- engine:
750
+ engine: ""
751
+ engine_version: ""
665
752
  device:
666
753
  type: feature phone
667
754
  brand: SG
@@ -674,13 +761,14 @@
674
761
  name: Brew
675
762
  short_name: BMP
676
763
  version: "3.1.5"
677
- platform:
764
+ platform: ""
678
765
  client:
679
766
  type: browser
680
767
  name: NetFront
681
768
  short_name: NF
682
769
  version: "3.5.1"
683
770
  engine: NetFront
771
+ engine_version: "3.5.1"
684
772
  device:
685
773
  type: feature phone
686
774
  brand: SY
@@ -693,13 +781,14 @@
693
781
  name: Brew
694
782
  short_name: BMP
695
783
  version: "1.0.2"
696
- platform:
784
+ platform: ""
697
785
  client:
698
786
  type: browser
699
787
  name: NetFront
700
788
  short_name: NF
701
789
  version: "3.5.1"
702
790
  engine: NetFront
791
+ engine_version: "3.5.1"
703
792
  device:
704
793
  type: feature phone
705
794
  brand: SY
@@ -715,6 +804,7 @@
715
804
  short_name: NF
716
805
  version: "3.4"
717
806
  engine: NetFront
807
+ engine_version: "3.4"
718
808
  device:
719
809
  type: feature phone
720
810
  brand: SY
@@ -730,6 +820,7 @@
730
820
  short_name: NF
731
821
  version: "3"
732
822
  engine: NetFront
823
+ engine_version: "3"
733
824
  device:
734
825
  type: feature phone
735
826
  brand: SY
@@ -751,20 +842,37 @@
751
842
  os:
752
843
  name: Windows CE
753
844
  short_name: WCE
754
- version:
755
- platform:
845
+ version: ""
846
+ platform: ""
756
847
  client:
757
848
  type: browser
758
849
  name: IE Mobile
759
850
  short_name: IM
760
851
  version: "8.12"
761
852
  engine: Trident
853
+ engine_version: ""
762
854
  device:
763
855
  type: feature phone
764
856
  brand: UT
765
857
  model: XV6175
766
858
  os_family: Windows Mobile
767
859
  browser_family: Internet Explorer
860
+ -
861
+ user_agent: VK-VK700 UP.Browser/6.2.3.4 (GUI) MMP/2.0
862
+ os: [ ]
863
+ client:
864
+ type: browser
865
+ name: Openwave Mobile Browser
866
+ short_name: OV
867
+ version: "6.2.3.4"
868
+ engine: ""
869
+ engine_version: ""
870
+ device:
871
+ type: feature phone
872
+ brand: VK
873
+ model: VK700
874
+ os_family: Unknown
875
+ browser_family: Unknown
768
876
  -
769
877
  user_agent: vk-vk900/1.1 up.browser/6.2.3.4 (gui) mmp/2.0
770
878
  os: [ ]
@@ -773,7 +881,8 @@
773
881
  name: Openwave Mobile Browser
774
882
  short_name: OV
775
883
  version: "6.2.3.4"
776
- engine:
884
+ engine: ""
885
+ engine_version: ""
777
886
  device:
778
887
  type: feature phone
779
888
  brand: VK