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
@@ -1,7 +1,7 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
@@ -17,6 +17,24 @@
17
17
  url: 'https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pubsub.1.html'
18
18
  type: 'Feed Reader'
19
19
 
20
+ - regex: 'BashPodder'
21
+ name: 'BashPodder'
22
+ version: ''
23
+ url: 'http://lincgeek.org/bashpodder/'
24
+ type: 'Feed Reader'
25
+
26
+ - regex: 'Breaker/v([\d\.]+)'
27
+ name: 'Breaker'
28
+ version: '$1'
29
+ url: 'https://www.breaker.audio/'
30
+ type: 'Feed Reader App'
31
+
32
+ - regex: 'Downcast/([\d\.]+)'
33
+ name: 'Downcast'
34
+ version: '$1'
35
+ url: 'http://downcastapp.com/'
36
+ type: 'Feed Reader App'
37
+
20
38
  - regex: 'FeedDemon(?:/(\d+[\.\d]+))?'
21
39
  name: 'FeedDemon'
22
40
  version: '$1'
@@ -29,6 +47,18 @@
29
47
  url: 'http://www.chebinliu.com/projects/iphone/feeddler-rss-reader/'
30
48
  type: 'Feed Reader App'
31
49
 
50
+ - regex: 'QuiteRSS(?:[/ ](\d+[\.\d]+))?'
51
+ name: 'QuiteRSS'
52
+ version: '$1'
53
+ url: https://quiterss.org
54
+ type: 'Feed Reader App'
55
+
56
+ - regex: 'gPodder/([\d\.]+)'
57
+ name: 'gPodder'
58
+ version: '$1'
59
+ url: 'http://gpodder.org/'
60
+ type: 'Feed Reader App'
61
+
32
62
  - regex: 'JetBrains Omea Reader(?:[/ ](\d+[\.\d]+))?'
33
63
  name: 'JetBrains Omea Reader'
34
64
  version: '$1'
@@ -65,7 +95,13 @@
65
95
  url: 'http://www.newsbeuter.org/'
66
96
  type: 'Feed Reader'
67
97
 
68
- - regex: 'Pulp(?:[/ ](\d+[\.\d]+))?'
98
+ - regex: 'PritTorrent/([\d\.]+)'
99
+ name: 'PritTorrent'
100
+ version: '$1'
101
+ url: 'http://bitlove.org'
102
+ type: 'Feed Reader'
103
+
104
+ - regex: 'Pulp[/ ](\d+[\.\d]+)'
69
105
  name: 'Pulp'
70
106
  version: '$1'
71
107
  url: 'http://www.acrylicapps.com/pulp/'
@@ -1,7 +1,7 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
@@ -31,4 +31,78 @@
31
31
 
32
32
  - regex: '(?:perlclient|libwww-perl)(?:/?(\d+[\.\d]+))?'
33
33
  name: 'Perl'
34
- version: '$1'
34
+ version: '$1'
35
+
36
+ - regex: 'okhttp/([\d\.]+)'
37
+ name: 'OkHttp'
38
+ version: '$1'
39
+
40
+ - regex: 'HTTP_Request2(?:/(\d+[\.\d]+))?'
41
+ name: 'HTTP_Request2'
42
+ version: '$1'
43
+
44
+ - regex: 'HTTP_Request2(?:/(\d+[\.\d]+))?'
45
+ name: 'HTTP_Request2'
46
+ version: '$1'
47
+ url: 'http://pear.php.net/package/http_request2'
48
+
49
+ - regex: 'Mechanize(?:/(\d+[\.\d]+))?'
50
+ name: 'Mechanize'
51
+ version: '$1'
52
+ url: 'http://github.com/sparklemotion/mechanize/'
53
+
54
+ - regex: 'aiohttp(?:/(\d+[\.\d]+))?'
55
+ name: 'aiohttp'
56
+ version: '$1'
57
+
58
+ - regex: 'Google-HTTP-Java-Client(?:/(\d+[\.\d\w-]+))?'
59
+ name: 'Google HTTP Java Client'
60
+ version: '$1'
61
+
62
+ - regex: 'WWW-Mechanize(?:/(\d+[\.\d]+))?'
63
+ name: 'WWW-Mechanize'
64
+ version: '$1'
65
+
66
+ - regex: 'Faraday(?: v(\d+[\.\d]+))?'
67
+ name: 'Faraday'
68
+ version: '$1'
69
+
70
+ - regex: '(?:Go-http-client|Go )/?(?:(\d+[\.\d]+))?(?: package http)?'
71
+ name: 'Go-http-client'
72
+ version: '$1'
73
+
74
+ - regex: 'urlgrabber(?:/(\d+[\.\d]+))?'
75
+ name: 'urlgrabber (yum)'
76
+ version: '$1'
77
+
78
+ - regex: 'libdnf(?:/(\d+[\.\d]+))?'
79
+ name: 'libdnf'
80
+ version: '$1'
81
+
82
+ - regex: 'HTTPie(?:/(\d+[\.\d]+))?'
83
+ name: 'HTTPie'
84
+ version: '$1'
85
+
86
+ - regex: 'rest-client/(\d+[\.\d]+).*ruby'
87
+ name: 'REST Client for Ruby'
88
+ version: '$1'
89
+
90
+ - regex: 'RestSharp/(\d+[\.\d]+)'
91
+ name: 'RestSharp'
92
+ version: '$1'
93
+ url: 'http://restsharp.org/'
94
+
95
+ - regex: 'scalaj-http/(\d+[\.\d]+)'
96
+ name: 'ScalaJ HTTP'
97
+ version: '$1'
98
+ url: 'https://github.com/scalaj/scalaj-http'
99
+
100
+ - regex: 'REST::Client/(\d+)'
101
+ name: 'Perl REST::Client'
102
+ version: '$1'
103
+ url: 'https://metacpan.org/pod/REST::Client'
104
+
105
+ - regex: 'node-fetch/(\d+[\.\d]+)'
106
+ name: 'Node Fetch'
107
+ version: $1
108
+ url: 'https://github.com/node-fetch/node-fetch'
@@ -1,10 +1,14 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
8
+ - regex: 'Audacious(?:[ /]([\d\.]+))?'
9
+ name: 'Audacious'
10
+ version: '$1'
11
+
8
12
  - regex: 'Banshee(?:[ /]([\d\.]+))?'
9
13
  name: 'Banshee'
10
14
  version: '$1'
@@ -17,13 +21,21 @@
17
21
  name: 'Clementine'
18
22
  version: '$1'
19
23
 
20
- - regex: 'iTunes(?:/([\d\.]+))?'
24
+ - regex: 'Deezer(?:/([\d\.]+))?'
25
+ name: 'Deezer'
26
+ version: '$1'
27
+
28
+ - regex: 'iTunes(?:-iPhone|-iPad)?(?:/([\d\.]+))?'
21
29
  name: 'iTunes'
22
30
  version: '$1'
23
31
 
24
32
  - regex: 'FlyCast(?:/([\d\.]+))?'
25
33
  name: 'FlyCast'
26
34
  version: '$1'
35
+
36
+ - regex: 'foobar2000(?:/([\d\.]+))?'
37
+ name: 'Foobar2000'
38
+ version: '$1'
27
39
 
28
40
  - regex: 'MediaMonkey(?:[ /](\d+[\.\d]+))?'
29
41
  name: 'MediaMonkey'
@@ -77,6 +89,14 @@
77
89
  name: 'Stagefright'
78
90
  version: '$1'
79
91
 
80
- - regex: 'Instacast(?:/([\d\.]+))? CFNetwork/([\d\.]+)'
81
- name: 'Instacast'
82
- version: '$1'
92
+ - regex: 'GoogleChirp(?:/(\d+[\.\d]+))?'
93
+ name: 'Google Podcasts'
94
+ version: '$1'
95
+
96
+ - regex: 'Music Player Daemon (?:(\d+[\.\d]+))?'
97
+ name: 'Music Player Daemon'
98
+ version: '$1'
99
+
100
+ - regex: 'mpv (?:(\d+[\.\d]+))?'
101
+ name: 'mpv'
102
+ version: '$1'
@@ -1,7 +1,7 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
@@ -10,16 +10,38 @@
10
10
  name: 'AndroidDownloadManager'
11
11
  version: '$1'
12
12
 
13
+ # Apple News
14
+ - regex: '(?:Apple)?News(?:[ /][\d\.]+)? Version(?:[ /]([\d\.]+))?'
15
+ name: 'Apple News'
16
+ version: '$1'
17
+
18
+ - regex: 'bPod'
19
+ name: 'bPod'
20
+ version: ''
21
+
22
+ # Facebook Messenger
23
+ - regex: '(?:MessengerForiOS|MESSENGER).(?:FBAV)(?:[ /]([\d\.]+))?'
24
+ name: 'Facebook Messenger'
25
+ version: '$1'
26
+
13
27
  # Facebook
14
28
  - regex: '(?:FBAV|com.facebook.katana)(?:[ /]([\d\.]+))?'
15
29
  name: 'Facebook'
16
30
  version: '$1'
31
+ - regex: '(?:FBAN|FBSV|FBID|FBBV)/'
32
+ name: 'Facebook'
33
+ version: ''
17
34
 
18
35
  # FeedR
19
36
  - regex: 'FeedR(?:/([\d\.]+))?'
20
37
  name: 'FeedR'
21
38
  version: '$1'
22
39
 
40
+ # Google Go
41
+ - regex: 'com.google.android.apps.searchlite'
42
+ name: 'Google Go'
43
+ version: ''
44
+
23
45
  # Google Play Kiosk
24
46
  - regex: 'com.google.android.apps.magazines'
25
47
  name: 'Google Play Newsstand'
@@ -45,6 +67,11 @@
45
67
  name: 'Pinterest'
46
68
  version: '$1'
47
69
 
70
+ # Podcatcher Deluxe
71
+ - regex: 'Podcatcher Deluxe'
72
+ name: 'Podcatcher Deluxe'
73
+ version: ''
74
+
48
75
  # YouTube
49
76
  - regex: 'com.google.android.youtube(?:/([\d\.]+))?'
50
77
  name: 'YouTube'
@@ -63,4 +90,142 @@
63
90
  # Line
64
91
  - regex: 'Line(?:[ /]([\d\.]+))'
65
92
  name: 'Line'
66
- version: '$1'
93
+ version: '$1'
94
+
95
+ # Instacast
96
+ - regex: 'Instacast(?:HD)?/(\d\.[\d\.abc]+) CFNetwork/([\d\.]+) Darwin/([\d\.]+)'
97
+ name: 'Instacast'
98
+ version: '$1'
99
+ -
100
+ regex: 'Podcasts/([\d\.]+)'
101
+ name: 'Podcasts'
102
+ version: '$1'
103
+ -
104
+ regex: 'Pocket Casts(?:, (?:Android|iOS) v([\d\.]+))?'
105
+ name: 'Pocket Casts'
106
+ version: '$1'
107
+ -
108
+ regex: 'Podcat/([\d\.]+)'
109
+ name: 'Podcat'
110
+ version: '$1'
111
+
112
+ -
113
+ regex: 'BeyondPod'
114
+ name: 'BeyondPod'
115
+ version:
116
+ -
117
+ regex: 'AntennaPod/?([\d\.]+)?'
118
+ name: 'AntennaPod'
119
+ version: '$1'
120
+ -
121
+ regex: 'Overcast/([\d\.]+)'
122
+ name: 'Overcast'
123
+ version: '$1'
124
+ -
125
+ regex: '(?:CastBox|fm.castbox.audiobook.radio.podcast)/?([\d\.]+)?'
126
+ name: 'CastBox'
127
+ version: '$1'
128
+ -
129
+ regex: 'Player FM'
130
+ name: 'Player FM'
131
+ version: ''
132
+ -
133
+ regex: 'Podkicker(?: Pro)?/([\d\.]+)'
134
+ name: 'Podkicker'
135
+ version: '$1'
136
+ -
137
+ regex: 'PodcastRepublic/([\d\.]+)'
138
+ name: 'Podcast Republic'
139
+ version: '$1'
140
+ -
141
+ regex: 'Castro/(\d+)'
142
+ name: 'Castro'
143
+ version: '$1'
144
+ -
145
+ regex: 'Castro 2 ([\d\.]+)/[\d]+ Like iTunes'
146
+ name: 'Castro 2'
147
+ version: '$1'
148
+ -
149
+ regex: 'Castro 2'
150
+ name: 'Castro 2'
151
+ version: ''
152
+ -
153
+ regex: 'DoggCatcher'
154
+ name: 'DoggCatcher'
155
+ version:
156
+ -
157
+ regex: 'PodcastAddict/v([\d]+)'
158
+ name: 'Podcast & Radio Addict'
159
+ version: '$1'
160
+ -
161
+ regex: 'Podcat/([\d]+) CFNetwork/([\d\.]+) Darwin/([\d\.]+)'
162
+ name: 'Podcat'
163
+ version: '$1'
164
+ -
165
+ regex: 'i[cC]atcher[^\d]+([\d\.]+)'
166
+ name: 'iCatcher'
167
+ version: '$1'
168
+ -
169
+ regex: 'YelpApp/([\d\.]+)'
170
+ name: 'Yelp Mobile'
171
+ version: '$1'
172
+ -
173
+ regex: 'jp.co.yahoo.android.yjtop/([\d\.]+)'
174
+ name: 'Yahoo! Japan'
175
+ version: '$1'
176
+ -
177
+ regex: 'RSSRadio/([\d]+)?'
178
+ name: 'RSSRadio'
179
+ version: '$1'
180
+ -
181
+ regex: 'SogouSearch Android[\d\.]+ version([\d\.]+)?'
182
+ name: 'SogouSearch App'
183
+ version: '$1'
184
+ -
185
+ regex: 'NewsArticle/([\d\.]+)?'
186
+ name: 'NewsArticle App'
187
+ version: '$1'
188
+ -
189
+ regex: 'tieba/([\d\.]+)?'
190
+ name: 'tieba'
191
+ version: '$1'
192
+ -
193
+ regex: 'com\.douban\.group/([\d\.]+)?'
194
+ name: 'douban App'
195
+ version: '$1'
196
+ -
197
+ regex: 'BingWeb/([\d\.]+)?'
198
+ name: 'BingWebApp'
199
+ version: '$1'
200
+ -
201
+ regex: 'GSA/([\d\.]+)?'
202
+ name: 'Google Search App'
203
+ version: '$1'
204
+ -
205
+ regex: 'Flipboard/([\d\.]+)?'
206
+ name: 'Flipboard App'
207
+ version: '$1'
208
+ -
209
+ regex: 'Instagram[ /]([\d\.]+)?'
210
+ name: 'Instagram App'
211
+ version: '$1'
212
+ -
213
+ regex: 'baiduboxapp/([\d\.]+)?'
214
+ name: 'Baidu Box App'
215
+ version: '$1'
216
+ -
217
+ regex: 'Crosswalk(?!.*(?:Streamy|QwantMobile))/([\d\.]+)?'
218
+ name: 'CrosswalkApp'
219
+ version: '$1'
220
+ -
221
+ regex: 'Twitter for iPhone[/]?([\d\.]+)?'
222
+ name: 'Twitter'
223
+ version: '$1'
224
+ -
225
+ regex: 'TopBuzz/([\d\.]+)'
226
+ name: 'TopBuzz'
227
+ version: '$1'
228
+ -
229
+ regex: 'Snapchat/([\d\.]+)'
230
+ name: 'Snapchat'
231
+ version: '$1'
@@ -1,7 +1,7 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
@@ -39,4 +39,13 @@
39
39
 
40
40
  - regex: 'The Bat!(?: Voyager)?(?:[/ ](\d+[\.\d]+))?'
41
41
  name: 'The Bat!'
42
+ version: '$1'
43
+
44
+ - regex: 'DAVdroid(?:/(\d+[\.\d]+))?'
45
+ name: 'DAVdroid'
46
+ version: '$1'
47
+
48
+ # SeaMonkey
49
+ - regex: '(?:SeaMonkey|Iceape)(?:/(\d+[\.\d]+))?'
50
+ name: 'SeaMonkey'
42
51
  version: '$1'
@@ -1,7 +1,7 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
@@ -1,12 +1,16 @@
1
1
  ###############
2
2
  # Device Detector - The Universal Device Detection library for parsing User Agents
3
3
  #
4
- # @link http://piwik.org
4
+ # @link https://matomo.org
5
5
  # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
6
6
  ###############
7
7
 
8
8
  # Tesla Model S
9
9
  Tesla:
10
- regex: 'QtCarBrowser'
10
+ regex: '(?:Tesla/[0-9.]+|QtCarBrowser)'
11
11
  device: 'car browser'
12
- model: 'Model S'
12
+ models:
13
+ - regex: 'QtCarBrowser'
14
+ model: 'Model S'
15
+ - regex: 'Tesla/[0-9.]+'
16
+ model: ''