device_detector 0.9.1 → 1.0.4
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.
- checksums.yaml +5 -5
- data/.rubocop.yml +49 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -9
- data/CHANGELOG.md +16 -3
- data/README.md +7 -9
- data/Rakefile +19 -13
- data/device_detector.gemspec +1 -0
- data/lib/device_detector.rb +32 -28
- data/lib/device_detector/bot.rb +2 -2
- data/lib/device_detector/client.rb +3 -2
- data/lib/device_detector/device.rb +44 -21
- data/lib/device_detector/memory_cache.rb +26 -19
- data/lib/device_detector/metadata_extractor.rb +7 -8
- data/lib/device_detector/model_extractor.rb +3 -3
- data/lib/device_detector/name_extractor.rb +2 -2
- data/lib/device_detector/os.rb +121 -111
- data/lib/device_detector/parser.rb +22 -9
- data/lib/device_detector/version.rb +3 -1
- data/lib/device_detector/version_extractor.rb +2 -3
- data/regexes/bots.yml +840 -20
- data/regexes/client/browser_engine.yml +11 -2
- data/regexes/client/browsers.yml +909 -108
- data/regexes/client/feed_readers.yml +38 -2
- data/regexes/client/libraries.yml +76 -2
- data/regexes/client/mediaplayers.yml +25 -5
- data/regexes/client/mobile_apps.yml +167 -2
- data/regexes/client/pim.yml +10 -1
- data/regexes/device/cameras.yml +1 -1
- data/regexes/device/car_browsers.yml +7 -3
- data/regexes/device/consoles.yml +3 -3
- data/regexes/device/mobiles.yml +10123 -465
- data/regexes/device/portable_media_player.yml +4 -6
- data/regexes/device/televisions.yml +18 -4
- data/regexes/oss.yml +115 -21
- data/regexes/vendorfragments.yml +6 -2
- data/spec/device_detector/concrete_user_agent_spec.rb +16 -17
- data/spec/device_detector/detector_fixtures_spec.rb +51 -11
- data/spec/device_detector/device_spec.rb +28 -48
- data/spec/device_detector/memory_cache_spec.rb +60 -28
- data/spec/device_detector/model_extractor_spec.rb +3 -3
- data/spec/device_detector/version_extractor_spec.rb +5 -6
- data/spec/device_detector_spec.rb +60 -69
- data/spec/fixtures/client/browser.yml +1785 -262
- data/spec/fixtures/client/feed_reader.yml +47 -35
- data/spec/fixtures/client/library.yml +112 -3
- data/spec/fixtures/client/mediaplayer.yml +32 -37
- data/spec/fixtures/client/mobile_app.yml +193 -6
- data/spec/fixtures/client/pim.yml +37 -18
- data/spec/fixtures/detector/bots.yml +1426 -118
- data/spec/fixtures/detector/camera.yml +36 -10
- data/spec/fixtures/detector/car_browser.yml +64 -3
- data/spec/fixtures/detector/console.yml +80 -26
- data/spec/fixtures/detector/desktop.yml +2222 -1589
- data/spec/fixtures/detector/feature_phone.yml +151 -42
- data/spec/fixtures/detector/feed_reader.yml +186 -121
- data/spec/fixtures/detector/mediaplayer.yml +113 -39
- data/spec/fixtures/detector/mobile_apps.yml +366 -21
- data/spec/fixtures/detector/phablet.yml +2597 -570
- data/spec/fixtures/detector/portable_media_player.yml +41 -16
- data/spec/fixtures/detector/smart_display.yml +8 -5
- data/spec/fixtures/detector/smart_speaker.yml +55 -0
- data/spec/fixtures/detector/smartphone-1.yml +5468 -5010
- data/spec/fixtures/detector/smartphone-10.yml +9977 -0
- data/spec/fixtures/detector/smartphone-11.yml +9891 -0
- data/spec/fixtures/detector/smartphone-12.yml +9906 -0
- data/spec/fixtures/detector/smartphone-13.yml +9920 -0
- data/spec/fixtures/detector/smartphone-14.yml +2662 -0
- data/spec/fixtures/detector/smartphone-2.yml +5213 -4635
- data/spec/fixtures/detector/smartphone-3.yml +5082 -4533
- data/spec/fixtures/detector/smartphone-4.yml +6806 -2625
- data/spec/fixtures/detector/smartphone-5.yml +9914 -0
- data/spec/fixtures/detector/smartphone-6.yml +9962 -0
- data/spec/fixtures/detector/smartphone-7.yml +9899 -0
- data/spec/fixtures/detector/smartphone-8.yml +9931 -0
- data/spec/fixtures/detector/smartphone-9.yml +9899 -0
- data/spec/fixtures/detector/smartphone.yml +5225 -4652
- data/spec/fixtures/detector/tablet-1.yml +4691 -4191
- data/spec/fixtures/detector/tablet-2.yml +9800 -71
- data/spec/fixtures/detector/tablet-3.yml +9959 -0
- data/spec/fixtures/detector/tablet-4.yml +4528 -0
- data/spec/fixtures/detector/tablet.yml +4664 -4177
- data/spec/fixtures/detector/tv.yml +3399 -1048
- data/spec/fixtures/detector/unknown.yml +1017 -977
- data/spec/fixtures/detector/wearable.yml +61 -0
- data/spec/fixtures/device/camera.yml +4 -3
- data/spec/fixtures/device/car_browser.yml +9 -2
- data/spec/fixtures/device/console.yml +15 -14
- data/spec/fixtures/parser/oss.yml +284 -2
- data/spec/fixtures/parser/vendorfragments.yml +8 -2
- metadata +50 -7
@@ -1,7 +1,7 @@
|
|
1
1
|
###############
|
2
2
|
# Device Detector - The Universal Device Detection library for parsing User Agents
|
3
3
|
#
|
4
|
-
# @link
|
4
|
+
# @link https://matomo.org
|
5
5
|
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
|
6
6
|
###############
|
7
7
|
|
@@ -19,10 +19,8 @@ Apple:
|
|
19
19
|
model: 'iPod Touch 4'
|
20
20
|
- regex: '(?:Apple-)?iPod5[C,]1'
|
21
21
|
model: 'iPod Touch 5'
|
22
|
-
- regex: '(?:Apple-)?
|
23
|
-
model: 'iPod Touch'
|
24
|
-
- regex: '(?:Apple-)?iPod1[C,]1'
|
25
|
-
model: 'iPod Touch'
|
22
|
+
- regex: '(?:Apple-)?iPod7[C,]1'
|
23
|
+
model: 'iPod Touch 6'
|
26
24
|
- regex: '(?:Apple-)?iPod'
|
27
25
|
model: 'iPod Touch'
|
28
26
|
|
@@ -58,4 +56,4 @@ Samsung:
|
|
58
56
|
- regex: 'YP-G50'
|
59
57
|
model: 'Galaxy Player 50'
|
60
58
|
- regex: 'YP-GB70D'
|
61
|
-
model: 'Galaxy Player 70 Plus'
|
59
|
+
model: 'Galaxy Player 70 Plus'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
###############
|
2
2
|
# Device Detector - The Universal Device Detection library for parsing User Agents
|
3
3
|
#
|
4
|
-
# @link
|
4
|
+
# @link https://matomo.org
|
5
5
|
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
|
6
6
|
#
|
7
7
|
# ATTENTION: This file may only include tv user agents that contain 'HbbTV/([1-9]{1}(\.[0-9]{1}){1,2})'
|
@@ -56,6 +56,16 @@ Grundig:
|
|
56
56
|
device: 'tv'
|
57
57
|
model: ''
|
58
58
|
|
59
|
+
# Hisense
|
60
|
+
Hisense:
|
61
|
+
regex: 'Hisense'
|
62
|
+
device: 'tv'
|
63
|
+
models:
|
64
|
+
- regex: '(L[A-Z]{2,3}[0-9]{2}[A-Z][0-9]{3,4}[A-Z]{0,6}[0-9]?[A-Z]?)'
|
65
|
+
model: '$1'
|
66
|
+
- regex: '(H[A-Z]?[0-9]{2}[A-Z][0-9]{3,4}[A-Z]{0,4})'
|
67
|
+
model: '$1'
|
68
|
+
|
59
69
|
# Humax
|
60
70
|
Humax:
|
61
71
|
regex: 'Humax'
|
@@ -101,6 +111,10 @@ LG:
|
|
101
111
|
models:
|
102
112
|
- regex: '(NetCast [0-9]{1}.[0-9]{1}|GLOBAL_PLAT3)'
|
103
113
|
model: '$1'
|
114
|
+
- regex: '(OLED[0-9]{2}[A-Z][0-9][A-Z])'
|
115
|
+
model: '$1'
|
116
|
+
- regex: 'LGE;? ?([0-9]{2}[A-Z]{2}[0-9]{2,4}[A-Z]?)'
|
117
|
+
model: '$1'
|
104
118
|
|
105
119
|
# Loewe
|
106
120
|
Loewe:
|
@@ -165,7 +179,7 @@ Samsung:
|
|
165
179
|
regex: 'Samsung|Maple_2011'
|
166
180
|
device: 'tv'
|
167
181
|
models:
|
168
|
-
- regex: 'SmartTV(
|
182
|
+
- regex: 'SmartTV(201[2-9])'
|
169
183
|
model: 'Smart TV $1'
|
170
184
|
- regex: 'Maple_2011'
|
171
185
|
model: 'Smart TV 2011'
|
@@ -213,7 +227,7 @@ Sony:
|
|
213
227
|
regex: 'Sony'
|
214
228
|
device: 'tv'
|
215
229
|
models:
|
216
|
-
- regex: '(KDL[0-9]{2}[A-Z]{1,2}[0-9]{
|
230
|
+
- regex: '(KDL?-?[0-9]{2}[A-Z]{1,2}[0-9]{1,5})'
|
217
231
|
model: '$1'
|
218
232
|
|
219
233
|
# TechniSat
|
@@ -279,4 +293,4 @@ Videoweb:
|
|
279
293
|
- regex: '(tv2n)'
|
280
294
|
model: '$1'
|
281
295
|
- regex: '(videowebtv)'
|
282
|
-
model: 'VideoWeb TV'
|
296
|
+
model: 'VideoWeb TV'
|
data/regexes/oss.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
###############
|
2
2
|
# Device Detector - The Universal Device Detection library for parsing User Agents
|
3
3
|
#
|
4
|
-
# @link
|
4
|
+
# @link https://matomo.org
|
5
5
|
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
|
6
6
|
###############
|
7
7
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
##########
|
32
32
|
# Windows Mobile
|
33
33
|
##########
|
34
|
-
- regex: 'Windows Phone (?:OS)
|
34
|
+
- regex: '(?:Windows Phone (?:OS)?|wds)[ ]?(\d+[\.\d]+)'
|
35
35
|
name: 'Windows Phone'
|
36
36
|
version: '$1'
|
37
37
|
|
@@ -45,7 +45,7 @@
|
|
45
45
|
version: '$1'
|
46
46
|
|
47
47
|
|
48
|
-
- regex: '(?:IEMobile|Windows Mobile)(?: (\d+[\.\d]+))?'
|
48
|
+
- regex: '(?:IEMobile|Windows ?Mobile)(?: (\d+[\.\d]+))?'
|
49
49
|
name: 'Windows Mobile'
|
50
50
|
version: '$1'
|
51
51
|
|
@@ -58,6 +58,19 @@
|
|
58
58
|
name: 'Windows RT'
|
59
59
|
version: '8.1'
|
60
60
|
|
61
|
+
##########
|
62
|
+
# Windows IoT
|
63
|
+
##########
|
64
|
+
- regex: 'Windows IoT 10.0'
|
65
|
+
name: 'Windows IoT'
|
66
|
+
version: '10'
|
67
|
+
|
68
|
+
##########
|
69
|
+
# KaiOS
|
70
|
+
##########
|
71
|
+
- regex: 'KAIOS(?:/(\d+[\.\d]+))?'
|
72
|
+
name: 'KaiOS'
|
73
|
+
version: '$1'
|
61
74
|
|
62
75
|
##########
|
63
76
|
# Custom Android Roms
|
@@ -78,10 +91,14 @@
|
|
78
91
|
name: 'MocorDroid'
|
79
92
|
version: '$1'
|
80
93
|
|
94
|
+
- regex: 'Fire OS(?:/(\d+[\.\d]*))?'
|
95
|
+
name: 'Fire OS'
|
96
|
+
version: '$1'
|
97
|
+
|
81
98
|
##########
|
82
99
|
# Android
|
83
100
|
##########
|
84
|
-
- regex: '(?:(?:Orca-)?Android|Adr)[ /](?:[a-z]+ )?(\d+[\.\d]
|
101
|
+
- regex: '(?:(?:Orca-)?Android|Adr)[ /](?:[a-z]+ )?(\d+[\.\d]*)'
|
85
102
|
name: 'Android'
|
86
103
|
version: '$1'
|
87
104
|
|
@@ -89,6 +106,18 @@
|
|
89
106
|
- regex: 'Android|Silk-Accelerated=[a-z]{4,5}'
|
90
107
|
name: 'Android'
|
91
108
|
version: ''
|
109
|
+
|
110
|
+
- regex: '(?:TwitterAndroid).*[ /](?:[a-z]+ )?(\d+[\.\d]*)'
|
111
|
+
name: 'Android'
|
112
|
+
version: '$1'
|
113
|
+
|
114
|
+
- regex: 'FB4A.*FBSV/(\d+[\.\d]*);'
|
115
|
+
name: 'Android'
|
116
|
+
version: '$1'
|
117
|
+
|
118
|
+
- regex: 'BeyondPod|AntennaPod|Podkicker|DoggCatcher|Player FM|okhttp|Podcatcher Deluxe'
|
119
|
+
name: 'Android'
|
120
|
+
version: ''
|
92
121
|
|
93
122
|
|
94
123
|
##########
|
@@ -122,9 +151,17 @@
|
|
122
151
|
##########
|
123
152
|
# Linux
|
124
153
|
##########
|
154
|
+
- regex: '(Ordissimo|webissimo3)'
|
155
|
+
name: 'Ordissimo'
|
156
|
+
version: ''
|
157
|
+
|
158
|
+
- regex: 'TOS; Linux'
|
159
|
+
name: 'TmaxOS'
|
160
|
+
version: ''
|
161
|
+
|
125
162
|
- regex: 'Maemo'
|
126
163
|
name: 'Maemo'
|
127
|
-
version: '
|
164
|
+
version: ''
|
128
165
|
|
129
166
|
- regex: 'Arch ?Linux(?:[ /\-](\d+[\.\d]+))?'
|
130
167
|
name: 'Arch Linux'
|
@@ -239,12 +276,59 @@
|
|
239
276
|
- regex: 'Windows'
|
240
277
|
name: 'Windows'
|
241
278
|
version: ''
|
242
|
-
|
243
|
-
|
279
|
+
|
280
|
+
|
281
|
+
##########
|
282
|
+
# Haiku OS
|
283
|
+
##########
|
284
|
+
- regex: 'Haiku'
|
285
|
+
name: 'Haiku OS'
|
286
|
+
version: ''
|
287
|
+
|
244
288
|
|
245
289
|
##########
|
246
290
|
# iOS
|
247
291
|
##########
|
292
|
+
- regex: 'CFNetwork/889'
|
293
|
+
name: 'iOS'
|
294
|
+
version: '11.1'
|
295
|
+
|
296
|
+
- regex: 'CFNetwork/887.*(x86_64)'
|
297
|
+
name: 'Mac'
|
298
|
+
version: '10.13'
|
299
|
+
|
300
|
+
- regex: 'CFNetwork/887'
|
301
|
+
name: 'iOS'
|
302
|
+
version: '11.0'
|
303
|
+
|
304
|
+
- regex: 'CFNetwork/811.*(x86_64)'
|
305
|
+
name: 'Mac'
|
306
|
+
version: '10.12'
|
307
|
+
|
308
|
+
- regex: 'CFNetwork/811'
|
309
|
+
name: 'iOS'
|
310
|
+
version: '10.3'
|
311
|
+
|
312
|
+
- regex: 'CFNetwork/808\.3'
|
313
|
+
name: 'iOS'
|
314
|
+
version: '10.3'
|
315
|
+
|
316
|
+
- regex: 'CFNetwork/808\.2'
|
317
|
+
name: 'iOS'
|
318
|
+
version: '10.2'
|
319
|
+
|
320
|
+
- regex: 'CFNetwork/808\.1'
|
321
|
+
name: 'iOS'
|
322
|
+
version: '10.1'
|
323
|
+
|
324
|
+
- regex: 'CFNetwork/808\.0'
|
325
|
+
name: 'iOS'
|
326
|
+
version: '10.0'
|
327
|
+
|
328
|
+
- regex: 'CFNetwork/808'
|
329
|
+
name: 'iOS'
|
330
|
+
version: '10'
|
331
|
+
|
248
332
|
- regex: 'CFNetwork/758\.4\.3'
|
249
333
|
name: 'iOS'
|
250
334
|
version: '9.3.2'
|
@@ -341,16 +425,31 @@
|
|
341
425
|
name: 'iOS'
|
342
426
|
version: '$1'
|
343
427
|
|
428
|
+
- regex: 'FBIOS.*FBSV/(\d+[\.\d]*);'
|
429
|
+
name: 'iOS'
|
430
|
+
version: '$1'
|
431
|
+
|
344
432
|
- regex: '(?:Apple-)?(?:iPhone|iPad|iPod)(?:.*Mac OS X.*Version/(\d+\.\d+)|; Opera)?'
|
345
433
|
name: 'iOS'
|
346
434
|
version: '$1'
|
347
435
|
|
436
|
+
- regex: 'Podcasts/(?:[\d\.]+)|Instacast(?:HD)?/(?:\d\.[\d\.abc]+)|Pocket Casts, iOS|Overcast|Castro|Podcat|i[cC]atcher|RSSRadio/'
|
437
|
+
name: 'iOS'
|
438
|
+
version: ''
|
439
|
+
|
440
|
+
- regex: 'iTunes-(iPod|iPad|iPhone)/(?:[\d\.]+)'
|
441
|
+
name: 'iOS'
|
442
|
+
version: ''
|
348
443
|
|
349
444
|
|
350
445
|
##########
|
351
446
|
# Mac
|
352
447
|
##########
|
353
448
|
|
449
|
+
- regex: 'CFNetwork/807'
|
450
|
+
name: 'Mac'
|
451
|
+
version: '10.12'
|
452
|
+
|
354
453
|
- regex: 'CFNetwork/760'
|
355
454
|
name: 'Mac'
|
356
455
|
version: '10.11'
|
@@ -391,7 +490,7 @@
|
|
391
490
|
name: 'Mac'
|
392
491
|
version: '10.2'
|
393
492
|
|
394
|
-
- regex: 'Mac OS X(?: (?:Version )?(\d+(?:[_\.]\d+)+))?'
|
493
|
+
- regex: 'Mac[ +]OS[ +]X(?:[ /](?:Version )?(\d+(?:[_\.]\d+)+))?'
|
395
494
|
name: 'Mac'
|
396
495
|
version: '$1'
|
397
496
|
|
@@ -399,7 +498,7 @@
|
|
399
498
|
name: 'Mac'
|
400
499
|
version: '$1'
|
401
500
|
|
402
|
-
- regex: 'Darwin|Macintosh|Mac_PowerPC|PPC|Mac PowerPC'
|
501
|
+
- regex: 'Darwin|Macintosh|Mac_PowerPC|PPC|Mac PowerPC|iMac|MacBook'
|
403
502
|
name: 'Mac'
|
404
503
|
version: ''
|
405
504
|
|
@@ -408,7 +507,7 @@
|
|
408
507
|
##########
|
409
508
|
# ChromeOS
|
410
509
|
##########
|
411
|
-
- regex: 'CrOS [a-z0-9_]+ (\d+[\.\d]+)'
|
510
|
+
- regex: 'CrOS [a-z0-9_]+ .* Chrome/(\d+[\.\d]+)'
|
412
511
|
name: 'Chrome OS'
|
413
512
|
version: '$1'
|
414
513
|
|
@@ -435,13 +534,9 @@
|
|
435
534
|
- regex: 'BlackBerry'
|
436
535
|
name: 'BlackBerry OS'
|
437
536
|
version: ''
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
# Haiku OS
|
442
|
-
##########
|
443
|
-
- regex: 'Haiku'
|
444
|
-
name: 'Haiku OS'
|
537
|
+
|
538
|
+
- regex: 'bPod'
|
539
|
+
name: 'BlackBerry OS'
|
445
540
|
version: ''
|
446
541
|
|
447
542
|
|
@@ -645,11 +740,10 @@
|
|
645
740
|
##########
|
646
741
|
# Gaming Console
|
647
742
|
##########
|
648
|
-
- regex: 'Nintendo Wii'
|
743
|
+
- regex: 'Nintendo (Wii|Switch)'
|
649
744
|
name: 'Nintendo'
|
650
|
-
version: '
|
651
|
-
|
652
|
-
|
745
|
+
version: '$1'
|
746
|
+
|
653
747
|
- regex: 'PlayStation ?([3|4])'
|
654
748
|
name: 'PlayStation'
|
655
749
|
version: '$1'
|
data/regexes/vendorfragments.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
###############
|
2
2
|
# Device Detector - The Universal Device Detection library for parsing User Agents
|
3
3
|
#
|
4
|
-
# @link
|
4
|
+
# @link https://matomo.org
|
5
5
|
# @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
|
6
6
|
###############
|
7
7
|
|
@@ -20,7 +20,7 @@ Sony:
|
|
20
20
|
|
21
21
|
Asus:
|
22
22
|
- 'MAAU'
|
23
|
-
- 'NP0[
|
23
|
+
- 'NP0[26789]'
|
24
24
|
- 'ASJB'
|
25
25
|
- 'ASU2(JS)?'
|
26
26
|
|
@@ -69,3 +69,7 @@ HP:
|
|
69
69
|
|
70
70
|
Hyrican:
|
71
71
|
- 'MANM(JS)?'
|
72
|
+
|
73
|
+
Ordissimo:
|
74
|
+
- 'Ordissimo'
|
75
|
+
- 'webissimo3'
|
@@ -13,7 +13,7 @@ describe DeviceDetector do
|
|
13
13
|
describe '#device_name' do
|
14
14
|
|
15
15
|
it 'returns device name' do
|
16
|
-
client.device_name.must_equal 'iPhone 5S'
|
16
|
+
value(client.device_name).must_equal 'iPhone 5S'
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -21,7 +21,7 @@ describe DeviceDetector do
|
|
21
21
|
describe '#device_type' do
|
22
22
|
|
23
23
|
it 'returns the device type' do
|
24
|
-
client.device_type.must_equal 'smartphone'
|
24
|
+
value(client.device_type).must_equal 'smartphone'
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -35,7 +35,7 @@ describe DeviceDetector do
|
|
35
35
|
describe '#os_name' do
|
36
36
|
|
37
37
|
it 'returns the OS name' do
|
38
|
-
client.os_name.must_equal 'Ubuntu'
|
38
|
+
value(client.os_name).must_equal 'Ubuntu'
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
@@ -49,7 +49,7 @@ describe DeviceDetector do
|
|
49
49
|
describe '#full_version' do
|
50
50
|
|
51
51
|
it 'returns the correct OS version' do
|
52
|
-
client.os_full_version.must_equal '10.10.1'
|
52
|
+
value(client.os_full_version).must_equal '10.10.1'
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
@@ -63,15 +63,15 @@ describe DeviceDetector do
|
|
63
63
|
let(:user_agent) { 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36' }
|
64
64
|
|
65
65
|
it 'returns the correct client name' do
|
66
|
-
client.name.must_equal 'Chrome'
|
66
|
+
value(client.name).must_equal 'Chrome'
|
67
67
|
end
|
68
68
|
|
69
69
|
it 'recognizes the device name' do
|
70
|
-
client.device_name.must_be_nil
|
70
|
+
value(client.device_name).must_be_nil
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'recognizes the device type' do
|
74
|
-
client.device_type.must_equal "desktop"
|
74
|
+
value(client.device_type).must_equal "desktop"
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
@@ -81,15 +81,15 @@ describe DeviceDetector do
|
|
81
81
|
let(:user_agent) { 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' }
|
82
82
|
|
83
83
|
it 'returns the correct client name' do
|
84
|
-
client.name.must_equal 'Chrome'
|
84
|
+
value(client.name).must_equal 'Chrome'
|
85
85
|
end
|
86
86
|
|
87
87
|
it 'recognizes the device name' do
|
88
|
-
client.device_name.must_be_nil
|
88
|
+
value(client.device_name).must_be_nil
|
89
89
|
end
|
90
90
|
|
91
91
|
it 'recognizes the device type' do
|
92
|
-
client.device_type.must_equal "desktop"
|
92
|
+
value(client.device_type).must_equal "desktop"
|
93
93
|
end
|
94
94
|
|
95
95
|
end
|
@@ -101,15 +101,15 @@ describe DeviceDetector do
|
|
101
101
|
let(:user_agent) { 'sprd-Galaxy-S5/1.0 Linux/2.6.35.7 Android/4.4.4 Release/11.29.2014 Browser/AppleWebKit533.1 (KHTML, like Gecko) Mozilla/5.0 Mobile' }
|
102
102
|
|
103
103
|
it 'returns the correct client name' do
|
104
|
-
client.name.must_equal "Android Browser"
|
104
|
+
value(client.name).must_equal "Android Browser"
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'recognizes the device name' do
|
108
|
-
client.device_name.must_equal "GALAXY S5"
|
108
|
+
value(client.device_name).must_equal "GALAXY S5"
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'recognizes the device type' do
|
112
|
-
client.device_type.must_equal "smartphone"
|
112
|
+
value(client.device_type).must_equal "smartphone"
|
113
113
|
end
|
114
114
|
|
115
115
|
end
|
@@ -119,18 +119,17 @@ describe DeviceDetector do
|
|
119
119
|
let(:user_agent) { 'Lenovo-A398t+_TD/S100 Linux/3.4.5 Android/4.1.2 Release/09.10.2013 Browser/AppleWebKit534.30 Mobile Safari/534.30' }
|
120
120
|
|
121
121
|
it 'returns the correct client name' do
|
122
|
-
client.name.must_equal "Android Browser"
|
122
|
+
value(client.name).must_equal "Android Browser"
|
123
123
|
end
|
124
124
|
|
125
125
|
it 'recognizes the device name' do
|
126
|
-
client.device_name.must_equal "A398t+"
|
126
|
+
value(client.device_name).must_equal "A398t+"
|
127
127
|
end
|
128
128
|
|
129
129
|
it 'recognizes the device type' do
|
130
|
-
client.device_type.must_equal "smartphone"
|
130
|
+
value(client.device_type).must_equal "smartphone"
|
131
131
|
end
|
132
132
|
|
133
133
|
end
|
134
134
|
|
135
135
|
end
|
136
|
-
|