device_detector 1.0.2 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +49 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +5 -6
  5. data/CHANGELOG.md +11 -0
  6. data/README.md +8 -7
  7. data/Rakefile +7 -4
  8. data/device_detector.gemspec +1 -0
  9. data/lib/device_detector/bot.rb +2 -2
  10. data/lib/device_detector/browser.rb +364 -0
  11. data/lib/device_detector/client.rb +11 -2
  12. data/lib/device_detector/device.rb +1168 -22
  13. data/lib/device_detector/memory_cache.rb +5 -5
  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 +148 -116
  18. data/lib/device_detector/parser.rb +22 -9
  19. data/lib/device_detector/version.rb +1 -1
  20. data/lib/device_detector/version_extractor.rb +10 -2
  21. data/lib/device_detector.rb +73 -40
  22. data/regexes/bots.yml +909 -59
  23. data/regexes/client/browser_engine.yml +14 -2
  24. data/regexes/client/browsers.yml +1356 -241
  25. data/regexes/client/feed_readers.yml +10 -10
  26. data/regexes/client/libraries.yml +75 -1
  27. data/regexes/client/mediaplayers.yml +39 -3
  28. data/regexes/client/mobile_apps.yml +524 -45
  29. data/regexes/client/pim.yml +55 -2
  30. data/regexes/device/cameras.yml +6 -6
  31. data/regexes/device/car_browsers.yml +23 -3
  32. data/regexes/device/consoles.yml +9 -3
  33. data/regexes/device/mobiles.yml +16903 -3199
  34. data/regexes/device/notebooks.yml +114 -0
  35. data/regexes/device/portable_media_player.yml +20 -3
  36. data/regexes/device/shell_tv.yml +117 -0
  37. data/regexes/device/televisions.yml +440 -35
  38. data/regexes/oss.yml +603 -165
  39. data/regexes/vendorfragments.yml +6 -2
  40. data/spec/device_detector/concrete_user_agent_spec.rb +38 -51
  41. data/spec/device_detector/detector_fixtures_spec.rb +36 -37
  42. data/spec/device_detector/device_spec.rb +52 -56
  43. data/spec/device_detector/memory_cache_spec.rb +19 -19
  44. data/spec/device_detector/model_extractor_spec.rb +3 -3
  45. data/spec/device_detector/version_extractor_spec.rb +5 -6
  46. data/spec/device_detector_spec.rb +26 -26
  47. data/spec/fixtures/client/browser.yml +2617 -555
  48. data/spec/fixtures/client/feed_reader.yml +34 -52
  49. data/spec/fixtures/client/library.yml +129 -38
  50. data/spec/fixtures/client/mediaplayer.yml +59 -28
  51. data/spec/fixtures/client/mobile_app.yml +589 -20
  52. data/spec/fixtures/client/pim.yml +92 -19
  53. data/spec/fixtures/detector/bots.yml +1749 -458
  54. data/spec/fixtures/detector/camera.yml +30 -24
  55. data/spec/fixtures/detector/car_browser.yml +199 -3
  56. data/spec/fixtures/detector/console.yml +107 -45
  57. data/spec/fixtures/detector/desktop.yml +3216 -758
  58. data/spec/fixtures/detector/feature_phone.yml +935 -181
  59. data/spec/fixtures/detector/feed_reader.yml +181 -193
  60. data/spec/fixtures/detector/mediaplayer.yml +157 -60
  61. data/spec/fixtures/detector/mobile_apps.yml +914 -136
  62. data/spec/fixtures/detector/peripheral.yml +271 -0
  63. data/spec/fixtures/detector/phablet.yml +5593 -1533
  64. data/spec/fixtures/detector/portable_media_player.yml +398 -32
  65. data/spec/fixtures/detector/smart_display.yml +183 -9
  66. data/spec/fixtures/detector/smart_speaker.yml +60 -0
  67. data/spec/fixtures/detector/smartphone-1.yml +3930 -4239
  68. data/spec/fixtures/detector/smartphone-10.yml +3985 -7366
  69. data/spec/fixtures/detector/smartphone-11.yml +5083 -3784
  70. data/spec/fixtures/detector/smartphone-12.yml +8989 -0
  71. data/spec/fixtures/detector/smartphone-13.yml +9412 -0
  72. data/spec/fixtures/detector/smartphone-14.yml +9477 -0
  73. data/spec/fixtures/detector/smartphone-15.yml +9281 -0
  74. data/spec/fixtures/detector/smartphone-16.yml +9678 -0
  75. data/spec/fixtures/detector/smartphone-17.yml +9965 -0
  76. data/spec/fixtures/detector/smartphone-18.yml +9806 -0
  77. data/spec/fixtures/detector/smartphone-19.yml +9965 -0
  78. data/spec/fixtures/detector/smartphone-2.yml +6670 -4375
  79. data/spec/fixtures/detector/smartphone-20.yml +9710 -0
  80. data/spec/fixtures/detector/smartphone-21.yml +8693 -0
  81. data/spec/fixtures/detector/smartphone-22.yml +10178 -0
  82. data/spec/fixtures/detector/smartphone-23.yml +9453 -0
  83. data/spec/fixtures/detector/smartphone-24.yml +9843 -0
  84. data/spec/fixtures/detector/smartphone-25.yml +9703 -0
  85. data/spec/fixtures/detector/smartphone-26.yml +10007 -0
  86. data/spec/fixtures/detector/smartphone-27.yml +4927 -0
  87. data/spec/fixtures/detector/smartphone-3.yml +4656 -4711
  88. data/spec/fixtures/detector/smartphone-4.yml +3518 -4479
  89. data/spec/fixtures/detector/smartphone-5.yml +3805 -4803
  90. data/spec/fixtures/detector/smartphone-6.yml +3745 -4693
  91. data/spec/fixtures/detector/smartphone-7.yml +3721 -4645
  92. data/spec/fixtures/detector/smartphone-8.yml +4564 -4699
  93. data/spec/fixtures/detector/smartphone-9.yml +3897 -4888
  94. data/spec/fixtures/detector/smartphone.yml +3154 -4141
  95. data/spec/fixtures/detector/tablet-1.yml +4742 -4576
  96. data/spec/fixtures/detector/tablet-2.yml +3803 -4731
  97. data/spec/fixtures/detector/tablet-3.yml +6210 -2309
  98. data/spec/fixtures/detector/tablet-4.yml +9062 -0
  99. data/spec/fixtures/detector/tablet-5.yml +9273 -0
  100. data/spec/fixtures/detector/tablet-6.yml +4588 -0
  101. data/spec/fixtures/detector/tablet.yml +3629 -4613
  102. data/spec/fixtures/detector/tv-1.yml +2501 -0
  103. data/spec/fixtures/detector/tv.yml +8856 -2064
  104. data/spec/fixtures/detector/unknown.yml +412 -587
  105. data/spec/fixtures/detector/wearable.yml +915 -0
  106. data/spec/fixtures/device/camera.yml +4 -3
  107. data/spec/fixtures/device/car_browser.yml +9 -2
  108. data/spec/fixtures/device/console.yml +15 -14
  109. data/spec/fixtures/device/notebook.yml +7 -0
  110. data/spec/fixtures/parser/oss.yml +1392 -21
  111. data/spec/fixtures/parser/vendorfragments.yml +57 -51
  112. metadata +70 -4
@@ -1,4 +1,5 @@
1
- -
1
+ ---
2
+ -
2
3
  user_agent: Audacious/3.6.2 neon/0.30.1
3
4
  os: [ ]
4
5
  client:
@@ -11,12 +12,11 @@
11
12
  model: ""
12
13
  os_family: Unknown
13
14
  browser_family: Unknown
14
- -
15
+ -
15
16
  user_agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20130316 Songbird/1.12.1 (20140112193149)
16
17
  os:
17
18
  name: GNU/Linux
18
- short_name: LIN
19
- version:
19
+ version: ""
20
20
  platform: x86
21
21
  client:
22
22
  type: mediaplayer
@@ -24,16 +24,15 @@
24
24
  version: "1.12.1"
25
25
  device:
26
26
  type: desktop
27
- brand:
28
- model:
27
+ brand: ""
28
+ model: ""
29
29
  os_family: GNU/Linux
30
30
  browser_family: Unknown
31
- -
31
+ -
32
32
  user_agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20130316 Nightingale/1.12.2 (20140112193149)
33
33
  os:
34
34
  name: GNU/Linux
35
- short_name: LIN
36
- version:
35
+ version: ""
37
36
  platform: x86
38
37
  client:
39
38
  type: mediaplayer
@@ -41,63 +40,63 @@
41
40
  version: "1.12.2"
42
41
  device:
43
42
  type: desktop
44
- brand:
45
- model:
43
+ brand: ""
44
+ model: ""
46
45
  os_family: GNU/Linux
47
46
  browser_family: Unknown
48
- -
47
+ -
49
48
  user_agent: iTunes/10.2.1 (Macintosh; Intel Mac OS X 10.7) AppleWebKit/534.20.8
50
49
  os:
51
50
  name: Mac
52
- short_name: MAC
53
51
  version: "10.7"
54
- platform:
52
+ platform: ""
55
53
  client:
56
54
  type: mediaplayer
57
55
  name: iTunes
58
56
  version: "10.2.1"
59
57
  device:
60
58
  type: desktop
61
- brand: AP
62
- model:
59
+ brand: Apple
60
+ model: ""
63
61
  os_family: Mac
64
62
  browser_family: Unknown
65
- -
63
+ -
66
64
  user_agent: iTunes/10.2.1 (Windows; Microsoft Windows 7 Enterprise Edition Service Pack 1 (Build 7601)) AppleWebKit/533.20.25
67
65
  os:
68
66
  name: Windows
69
- short_name: WIN
70
67
  version: "7"
71
- platform:
68
+ platform: ""
72
69
  client:
73
70
  type: mediaplayer
74
71
  name: iTunes
75
72
  version: "10.2.1"
76
73
  device:
77
74
  type: desktop
78
- brand:
79
- model:
75
+ brand: ""
76
+ model: ""
80
77
  os_family: Windows
81
78
  browser_family: Unknown
82
- -
79
+ -
83
80
  user_agent: SAMSUNG-GT-S3850/S3850CXKD1 SHP/VPP/R5 Dolfin/2.0 NexPlayer/3.0 SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1 OPN-B
84
- os: [ ]
81
+ os:
82
+ name: Java ME
83
+ version: ""
84
+ platform: ""
85
85
  client:
86
86
  type: mediaplayer
87
87
  name: NexPlayer
88
88
  version: "3.0"
89
89
  device:
90
90
  type: smartphone
91
- brand: SA
91
+ brand: Samsung
92
92
  model: GT-S3850
93
- os_family: Unknown
93
+ os_family: Real-time OS
94
94
  browser_family: Unknown
95
- -
95
+ -
96
96
  user_agent: Deezer/5.4.21.97 (Android; 6.0; Mobile; fr) WIKO U FEEL
97
97
  os:
98
98
  name: Android
99
- short_name: AND
100
- version: ""
99
+ version: "6.0"
101
100
  platform: ""
102
101
  client:
103
102
  type: mediaplayer
@@ -105,28 +104,27 @@
105
104
  version: "5.4.21.97"
106
105
  device:
107
106
  type: smartphone
108
- brand: WI
107
+ brand: Wiko
109
108
  model: U Feel
110
109
  os_family: Android
111
110
  browser_family: Unknown
112
- -
111
+ -
113
112
  user_agent: FlyCast/1.34 (BlackBerry; 8330/4.5.0.131 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/-1)
114
113
  os:
115
114
  name: BlackBerry OS
116
- short_name: BLB
117
- version:
118
- platform:
115
+ version: ""
116
+ platform: ""
119
117
  client:
120
118
  type: mediaplayer
121
119
  name: FlyCast
122
120
  version: "1.34"
123
121
  device:
124
122
  type: smartphone
125
- brand: RM
123
+ brand: RIM
126
124
  model: BlackBerry
127
125
  os_family: BlackBerry
128
126
  browser_family: Unknown
129
- -
127
+ -
130
128
  user_agent: NSPlayer/10.0.0.4072 WMFSDK/10.0
131
129
  os: [ ]
132
130
  client:
@@ -134,76 +132,175 @@
134
132
  name: Windows Media Player
135
133
  version: "10.0.0.4072"
136
134
  device:
137
- type:
138
- brand:
139
- model:
135
+ type: ""
136
+ brand: ""
137
+ model: ""
140
138
  os_family: Unknown
141
139
  browser_family: Unknown
142
- -
140
+ -
143
141
  user_agent: XBMC/9.04 r19840 (Mac OS X; Darwin 9.6.0; http://www.xbmc.org)
144
142
  os:
145
143
  name: Mac
146
- short_name: MAC
147
- version:
148
- platform:
144
+ version: ""
145
+ platform: ""
149
146
  client:
150
147
  type: mediaplayer
151
148
  name: XBMC
152
149
  version: "9.04"
153
150
  device:
154
151
  type: desktop
155
- brand: AP
156
- model:
152
+ brand: Apple
153
+ model: ""
157
154
  os_family: Mac
158
155
  browser_family: Unknown
159
- -
156
+ -
160
157
  user_agent: SubStream/0.7 CFNetwork/485.12.30 Darwin/10.4.0
161
158
  os:
162
159
  name: iOS
163
- short_name: IOS
164
160
  version: "4.2"
165
- platform:
161
+ platform: ""
166
162
  client:
167
163
  type: mediaplayer
168
164
  name: SubStream
169
165
  version: "0.7"
170
166
  device:
171
- type:
172
- brand: AP
173
- model:
167
+ type: ""
168
+ brand: Apple
169
+ model: ""
174
170
  os_family: iOS
175
171
  browser_family: Unknown
176
- -
172
+ -
177
173
  user_agent: Samsung GT-I9505 stagefright/1.2 (Linux;Android 4.4.2)
178
174
  os:
179
175
  name: Android
180
- short_name: AND
181
176
  version: "4.4.2"
182
- platform:
177
+ platform: ""
183
178
  client:
184
179
  type: mediaplayer
185
180
  name: Stagefright
186
181
  version: "1.2"
187
182
  device:
188
183
  type: smartphone
189
- brand: SA
190
- model: GALAXY S4
184
+ brand: Samsung
185
+ model: Galaxy S4
191
186
  os_family: Android
192
187
  browser_family: Unknown
193
- -
188
+ -
194
189
  user_agent: Kodi/14.0 (Macintosh; Intel Mac OS X 10_10_3) App_Bitness/64 Version/14.0-Git:2014-12-23-ad747d9-dirty
195
190
  os:
196
191
  name: Mac
197
- short_name: MAC
198
192
  version: "10.10.3"
199
- platform:
193
+ platform: ""
200
194
  client:
201
195
  type: mediaplayer
202
196
  name: Kodi
203
197
  version: "14.0"
204
198
  device:
205
199
  type: desktop
206
- brand: AP
207
- model:
200
+ brand: Apple
201
+ model: ""
208
202
  os_family: Mac
209
203
  browser_family: Unknown
204
+ -
205
+ user_agent: GoogleChirp/1.0.1 (Linux; Android/5.0) GOOG/7 AppleWebKit/534.30 (KHTML, like Gecko)
206
+ os:
207
+ name: Android
208
+ version: "5.0"
209
+ platform: ""
210
+ client:
211
+ type: mediaplayer
212
+ name: Google Podcasts
213
+ version: "1.0.1"
214
+ device:
215
+ type: ""
216
+ brand: ""
217
+ model: ""
218
+ os_family: Android
219
+ browser_family: Unknown
220
+ -
221
+ user_agent: Music Player Daemon 0.19.21
222
+ os: [ ]
223
+ client:
224
+ type: mediaplayer
225
+ name: Music Player Daemon
226
+ version: "0.19.21"
227
+ device:
228
+ type: ""
229
+ brand: ""
230
+ model: ""
231
+ os_family: Unknown
232
+ browser_family: Unknown
233
+ -
234
+ user_agent: mpv 0.29.1
235
+ os: [ ]
236
+ client:
237
+ type: mediaplayer
238
+ name: mpv
239
+ version: "0.29.1"
240
+ device:
241
+ type: ""
242
+ brand: ""
243
+ model: ""
244
+ os_family: Unknown
245
+ browser_family: Unknown
246
+ -
247
+ user_agent: foobar2000/1.6.1
248
+ os: [ ]
249
+ client:
250
+ type: mediaplayer
251
+ name: Foobar2000
252
+ version: 1.6.1
253
+ device:
254
+ type: ""
255
+ brand: ""
256
+ model: ""
257
+ os_family: Unknown
258
+ browser_family: Unknown
259
+ -
260
+ user_agent: Downcast/2.9.11 (Mac OS X Version 10.11.3 (Build 15D21))
261
+ os:
262
+ name: Mac
263
+ version: "10.11.3"
264
+ platform: ""
265
+ client:
266
+ type: mediaplayer
267
+ name: Downcast
268
+ version: "2.9.11"
269
+ device:
270
+ type: desktop
271
+ brand: Apple
272
+ model: ""
273
+ os_family: Mac
274
+ browser_family: Unknown
275
+ -
276
+ user_agent: 'Downcast/1241 CFNetwork/673.4 Darwin/13.3.0 (x86_64) (MacBookAir4%2C2)'
277
+ os:
278
+ name: Mac
279
+ version: 10.9.4
280
+ platform: x64
281
+ client:
282
+ type: mediaplayer
283
+ name: Downcast
284
+ version: ""
285
+ device:
286
+ type: desktop
287
+ brand: Apple
288
+ model: MacBook Air 13" (2011)
289
+ os_family: Mac
290
+ browser_family: Unknown
291
+ -
292
+ user_agent: MediaGo/3.2.0.191 (Windows NT 10.0; WOW64) PlaybackEngine/2.20.103.05220
293
+ os:
294
+ name: Windows
295
+ version: "10"
296
+ platform: x64
297
+ client:
298
+ type: mediaplayer
299
+ name: Sony Media Go
300
+ version: 3.2.0.191
301
+ device:
302
+ type: desktop
303
+ brand: ""
304
+ model: ""
305
+ os_family: Windows
306
+ browser_family: Unknown