user_agent_parser 2.0.0 → 2.1.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.
Potentially problematic release.
This version of user_agent_parser might be problematic. Click here for more details.
- checksums.yaml +15 -0
- data/Readme.md +6 -0
- data/lib/user_agent_parser/parser.rb +6 -2
- data/vendor/ua-parser/regexes.yaml +19 -2
- metadata +5 -7
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDY2ZWUzN2RkZmIzYWU2NDcwZmM2Zjk0OTUxMGE3ZDVmNTZjN2ZkNQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWE4ODE2OTY3NjIwOGY2MWYxY2E3YmEzMjgxYWIxYzU3YTJiZGYxZQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGJhMmVmNjMxMDk0ZWUzNDM1MDlmM2NmY2JlNDk4MTVjYzEyNjIxZGFjMDli
|
10
|
+
MWYyMzg1ZTIwZTdkNzIxNmRjZTI3NTMyNWU1YzFhNDE1ZGMxZjM5MTZjMTYw
|
11
|
+
ZGM3NWFmODMyY2NkZWRiMjkwNTcyODUwY2ZhZWM4Njg4YTk4ZDc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZWU1ZjE4YTQ1MmFiNjZlZGE0NGQzOTQ2ODQ2OGEwZmE0MTBhYWZkOGIzZjE5
|
14
|
+
ZWQwYjJjZDI1MGJmMWMyMDVlYTE4YzkxNmRhZjJlMDYyNGQ2YWEzY2IyYTE0
|
15
|
+
ZmQ4MjM4ZjlhOTA2MDQ1MGZiZGVjMmEwNjAwMjE4OTIxN2Q1Zjk=
|
data/Readme.md
CHANGED
@@ -68,6 +68,12 @@ UserAgentParser::Parser.new(patterns_path: '/some/path/to/regexes.yaml').parse(u
|
|
68
68
|
|
69
69
|
All accepted pull requests will earn you commit and release rights.
|
70
70
|
|
71
|
+
## Releasing a new version
|
72
|
+
|
73
|
+
1. Update the version in user_agent_parser.gemspec
|
74
|
+
2. `git commit user_agent_parser.gemspec -m 'Version bump'`
|
75
|
+
3. `rake release`
|
76
|
+
|
71
77
|
## License
|
72
78
|
|
73
79
|
MIT
|
@@ -71,7 +71,7 @@ module UserAgentParser
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def user_agent_from_pattern_match(pattern, match, os = nil, device = nil)
|
74
|
-
name, v1, v2, v3 = match[1], match[2], match[3], match[4]
|
74
|
+
name, v1, v2, v3, v4 = match[1], match[2], match[3], match[4], match[5]
|
75
75
|
|
76
76
|
if pattern["family_replacement"]
|
77
77
|
name = pattern["family_replacement"].sub('$1', name || '')
|
@@ -89,7 +89,11 @@ module UserAgentParser
|
|
89
89
|
v3 = pattern["v3_replacement"].sub('$1', v3 || '')
|
90
90
|
end
|
91
91
|
|
92
|
-
|
92
|
+
if pattern["v4_replacement"]
|
93
|
+
v4 = pattern["v4_replacement"].sub('$1', v4 || '')
|
94
|
+
end
|
95
|
+
|
96
|
+
version = version_from_segments(v1, v2, v3, v4)
|
93
97
|
|
94
98
|
UserAgent.new(name, version, os, device)
|
95
99
|
end
|
@@ -61,6 +61,10 @@ user_agent_parsers:
|
|
61
61
|
- regex: '(Opera Mini)/att/(\d+)\.(\d+)'
|
62
62
|
- regex: '(Opera)/9.80.*Version/(\d+)\.(\d+)(?:\.(\d+))?'
|
63
63
|
|
64
|
+
# Opera 14 for Android uses a WebKit render engine.
|
65
|
+
- regex: '(?:Mobile Safari).*(OPR)/(\d+)\.(\d+)\.(\d+)'
|
66
|
+
family_replacement: 'Opera Mobile'
|
67
|
+
|
64
68
|
# Palm WebOS looks a lot like Safari.
|
65
69
|
- regex: '(hpw|web)OS/(\d+)\.(\d+)(?:\.(\d+))?'
|
66
70
|
family_replacement: 'webOS Browser'
|
@@ -349,6 +353,9 @@ user_agent_parsers:
|
|
349
353
|
- regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+))?'
|
350
354
|
family_replacement: 'Amazon Silk'
|
351
355
|
|
356
|
+
# Phantomjs, should go before Safari
|
357
|
+
- regex: '(PhantomJS)/(\d+)\.(\d+)\.(\d+)'
|
358
|
+
|
352
359
|
# WebKit Nightly
|
353
360
|
- regex: '(AppleWebKit)/(\d+)\.?(\d+)?\+ .* Safari'
|
354
361
|
family_replacement: 'WebKit Nightly'
|
@@ -372,7 +379,7 @@ user_agent_parsers:
|
|
372
379
|
- regex: '(Phantom)/V(\d+)\.(\d+)'
|
373
380
|
family_replacement: 'Phantom Browser'
|
374
381
|
|
375
|
-
- regex: '(
|
382
|
+
- regex: '([MS]?IE) (\d+)\.(\d+)'
|
376
383
|
family_replacement: 'IE'
|
377
384
|
|
378
385
|
- regex: '(python-requests)/(\d+)\.(\d+)'
|
@@ -752,6 +759,16 @@ device_parsers:
|
|
752
759
|
- regex: '(AppleTV)'
|
753
760
|
device_replacement: 'AppleTV'
|
754
761
|
|
762
|
+
##########
|
763
|
+
# Catch the google mobile crawler before checking for iPhones.
|
764
|
+
##########
|
765
|
+
|
766
|
+
- regex: 'AdsBot-Google-Mobile'
|
767
|
+
device_replacement: 'Spider'
|
768
|
+
|
769
|
+
- regex: 'Googlebot-Mobile/(\d+).(\d+)'
|
770
|
+
device_replacement: 'Spider'
|
771
|
+
|
755
772
|
##########
|
756
773
|
# complete but probably catches spoofs
|
757
774
|
# iSTUFF
|
@@ -963,6 +980,6 @@ device_parsers:
|
|
963
980
|
##########
|
964
981
|
# Spiders (this is hack...)
|
965
982
|
##########
|
966
|
-
- regex: '(bot|borg|google(^tv)|yahoo|slurp|msnbot|msrbot|openbot|archiver|netresearch|lycos|scooter|altavista|teoma|gigabot|baiduspider|blitzbot|oegp|charlotte|furlbot|http%20client|polybot|htdig|ichiro|mogimogi|larbin|pompos|scrubby|searchsight|seekbot|semanticdiscovery|silk|snappy|speedy|spider|voila|vortex|voyager|zao|zeal|fast\-webcrawler|converacrawler|dataparksearch|findlinks)'
|
983
|
+
- regex: '(bot|borg|google(^tv)|yahoo|slurp|msnbot|msrbot|openbot|archiver|netresearch|lycos|scooter|altavista|teoma|gigabot|baiduspider|blitzbot|oegp|charlotte|furlbot|http%20client|polybot|htdig|ichiro|mogimogi|larbin|pompos|scrubby|searchsight|seekbot|semanticdiscovery|silk|snappy|speedy|spider|voila|vortex|voyager|zao|zeal|fast\-webcrawler|converacrawler|dataparksearch|findlinks|crawler)'
|
967
984
|
device_replacement: 'Spider'
|
968
985
|
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_agent_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tim Lucas
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-09 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A simple, comprehensive Ruby gem for parsing user agent strings with
|
15
14
|
the help of BrowserScope's UA database
|
@@ -30,27 +29,26 @@ files:
|
|
30
29
|
homepage: http://github.com/toolmantim/user_agent_parser
|
31
30
|
licenses:
|
32
31
|
- MIT
|
32
|
+
metadata: {}
|
33
33
|
post_install_message:
|
34
34
|
rdoc_options: []
|
35
35
|
require_paths:
|
36
36
|
- lib
|
37
37
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
38
|
requirements:
|
40
39
|
- - ! '>='
|
41
40
|
- !ruby/object:Gem::Version
|
42
41
|
version: 1.8.7
|
43
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
43
|
requirements:
|
46
44
|
- - ! '>='
|
47
45
|
- !ruby/object:Gem::Version
|
48
46
|
version: '0'
|
49
47
|
requirements: []
|
50
48
|
rubyforge_project:
|
51
|
-
rubygems_version:
|
49
|
+
rubygems_version: 2.0.3
|
52
50
|
signing_key:
|
53
|
-
specification_version:
|
51
|
+
specification_version: 4
|
54
52
|
summary: A simple, comprehensive Ruby gem for parsing user agent strings with the
|
55
53
|
help of BrowserScope's UA database
|
56
54
|
test_files: []
|