useragent 0.16.3 → 0.16.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/user_agent/browsers/apple_core_media.rb +16 -20
- data/lib/user_agent/browsers/base.rb +1 -1
- data/lib/user_agent/browsers/chrome.rb +15 -19
- data/lib/user_agent/browsers/internet_explorer.rb +1 -0
- data/lib/user_agent/browsers/itunes.rb +3 -5
- data/lib/user_agent/browsers/libavformat.rb +1 -5
- data/lib/user_agent/browsers/opera.rb +14 -10
- data/lib/user_agent/browsers/webkit.rb +18 -22
- data/lib/user_agent/browsers/windows_media_player.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e43d6316204c15aaad84fa02b020866075b39fa8
|
4
|
+
data.tar.gz: b716e6cfe14f3be5bbdfbaa3c9c750203cec9d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba86b3534c32e44b16c1b894f40b4be839e629fa81cd73dec2055f3ce95991fb0cb02a7055591eb3f6a7781713fb4122eb04133f43239672e73a8b1a81a1e01
|
7
|
+
data.tar.gz: b708812c912e47f4ae9bfedaf385bdd59dc42011a100a33868514bc68399713a561843d195472c6a253e1e599b507dac78684f4b83a6d66380bae5da39859a10
|
@@ -11,13 +11,13 @@ class UserAgent
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def application
|
14
|
-
|
14
|
+
self.reject { |agent| agent.comment.nil? || agent.comment.empty? }.first
|
15
15
|
end
|
16
16
|
|
17
17
|
def platform
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
return unless application
|
19
|
+
|
20
|
+
if application.comment[0] =~ /Windows/
|
21
21
|
'Windows'
|
22
22
|
else
|
23
23
|
application.comment[0]
|
@@ -29,27 +29,23 @@ class UserAgent
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def os
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
OperatingSystems.normalize_os(application.comment[2])
|
41
|
-
end
|
32
|
+
return unless application
|
33
|
+
|
34
|
+
if application.comment[0] =~ /Windows NT/
|
35
|
+
OperatingSystems.normalize_os(application.comment[0])
|
36
|
+
elsif application.comment[2].nil?
|
37
|
+
OperatingSystems.normalize_os(application.comment[1])
|
38
|
+
elsif application.comment[1] =~ /Android/
|
39
|
+
OperatingSystems.normalize_os(application.comment[1])
|
42
40
|
else
|
43
|
-
|
41
|
+
OperatingSystems.normalize_os(application.comment[2])
|
44
42
|
end
|
45
43
|
end
|
46
44
|
|
47
45
|
def localization
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
application.comment[3]
|
52
|
-
end
|
46
|
+
return unless application
|
47
|
+
|
48
|
+
application.comment[3]
|
53
49
|
end
|
54
50
|
end
|
55
51
|
end
|
@@ -31,9 +31,9 @@ class UserAgent
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def platform
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
return unless application
|
35
|
+
|
36
|
+
if application.comment[0] =~ /Windows/
|
37
37
|
'Windows'
|
38
38
|
elsif application.comment.any? { |c| c =~ /CrOS/ }
|
39
39
|
'ChromeOS'
|
@@ -49,27 +49,23 @@ class UserAgent
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def os
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
OperatingSystems.normalize_os(application.comment[2])
|
61
|
-
end
|
52
|
+
return unless application
|
53
|
+
|
54
|
+
if application.comment[0] =~ /Windows NT/
|
55
|
+
OperatingSystems.normalize_os(application.comment[0])
|
56
|
+
elsif application.comment[2].nil?
|
57
|
+
OperatingSystems.normalize_os(application.comment[1])
|
58
|
+
elsif application.comment[1] =~ /Android/
|
59
|
+
OperatingSystems.normalize_os(application.comment[1])
|
62
60
|
else
|
63
|
-
|
61
|
+
OperatingSystems.normalize_os(application.comment[2])
|
64
62
|
end
|
65
63
|
end
|
66
64
|
|
67
65
|
def localization
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
application.comment[3]
|
72
|
-
end
|
66
|
+
return unless application
|
67
|
+
|
68
|
+
application.comment[3]
|
73
69
|
end
|
74
70
|
end
|
75
71
|
end
|
@@ -30,8 +30,8 @@ class UserAgent
|
|
30
30
|
|
31
31
|
# @return [nil, Version] The WebKit version in use if we have it
|
32
32
|
def build
|
33
|
-
|
34
|
-
end
|
33
|
+
super if webkit
|
34
|
+
end
|
35
35
|
|
36
36
|
# Parses the operating system in use.
|
37
37
|
#
|
@@ -66,10 +66,8 @@ class UserAgent
|
|
66
66
|
full_os = application.comment[1]
|
67
67
|
|
68
68
|
full_os = "#{full_os})" if full_os =~ /\(Build [0-9][0-9][0-9][0-9]\z/ # The regex chops the ) off :(
|
69
|
-
|
69
|
+
|
70
70
|
full_os
|
71
|
-
else
|
72
|
-
nil
|
73
71
|
end
|
74
72
|
end
|
75
73
|
end
|
@@ -15,11 +15,7 @@ class UserAgent
|
|
15
15
|
|
16
16
|
# @return [nil, Version] If the product is NSPlayer, we don't have a version
|
17
17
|
def version
|
18
|
-
|
19
|
-
nil
|
20
|
-
else
|
21
|
-
super
|
22
|
-
end
|
18
|
+
super unless detect_product("NSPlayer")
|
23
19
|
end
|
24
20
|
|
25
21
|
# @return [nil] Lavf doesn't return us anything here
|
@@ -24,9 +24,9 @@ class UserAgent
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def platform
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
return unless application.comment
|
28
|
+
|
29
|
+
if application.comment[0] =~ /Windows/
|
30
30
|
"Windows"
|
31
31
|
else
|
32
32
|
application.comment[0]
|
@@ -36,7 +36,7 @@ class UserAgent
|
|
36
36
|
def security
|
37
37
|
if application.comment.nil?
|
38
38
|
:strong
|
39
|
-
elsif
|
39
|
+
elsif macintosh?
|
40
40
|
Security[application.comment[2]]
|
41
41
|
elsif mini?
|
42
42
|
Security[application.comment[-2]]
|
@@ -50,9 +50,9 @@ class UserAgent
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def os
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
return unless application.comment
|
54
|
+
|
55
|
+
if application.comment[0] =~ /Windows/
|
56
56
|
OperatingSystems.normalize_os(application.comment[0])
|
57
57
|
else
|
58
58
|
application.comment[1]
|
@@ -60,9 +60,9 @@ class UserAgent
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def localization
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
return unless application.comment
|
64
|
+
|
65
|
+
if macintosh?
|
66
66
|
application.comment[3]
|
67
67
|
else
|
68
68
|
application.comment[2]
|
@@ -73,6 +73,10 @@ class UserAgent
|
|
73
73
|
def mini?
|
74
74
|
/Opera Mini/ === application
|
75
75
|
end
|
76
|
+
|
77
|
+
def macintosh?
|
78
|
+
platform == 'Macintosh'
|
79
|
+
end
|
76
80
|
end
|
77
81
|
end
|
78
82
|
end
|
@@ -66,13 +66,13 @@ class UserAgent
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def application
|
69
|
-
|
69
|
+
self.reject { |agent| agent.comment.nil? || agent.comment.empty? }.first
|
70
70
|
end
|
71
71
|
|
72
72
|
def platform
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
return unless application
|
74
|
+
|
75
|
+
if application.comment[0] =~ /Windows/
|
76
76
|
'Windows'
|
77
77
|
elsif application.comment[0] == 'BB10'
|
78
78
|
'BlackBerry'
|
@@ -92,29 +92,25 @@ class UserAgent
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def os
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
OperatingSystems.normalize_os(application.comment[2])
|
106
|
-
end
|
95
|
+
return unless application
|
96
|
+
|
97
|
+
if application.comment[0] =~ /Windows NT/
|
98
|
+
OperatingSystems.normalize_os(application.comment[0])
|
99
|
+
elsif application.comment[2].nil?
|
100
|
+
OperatingSystems.normalize_os(application.comment[1])
|
101
|
+
elsif application.comment[1] =~ /Android/
|
102
|
+
OperatingSystems.normalize_os(application.comment[1])
|
103
|
+
elsif (os_string = application.comment.detect { |c| c =~ OperatingSystems::IOS_VERSION_REGEX })
|
104
|
+
OperatingSystems.normalize_os(os_string)
|
107
105
|
else
|
108
|
-
|
106
|
+
OperatingSystems.normalize_os(application.comment[2])
|
109
107
|
end
|
110
108
|
end
|
111
109
|
|
112
110
|
def localization
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
application.comment[3]
|
117
|
-
end
|
111
|
+
return unless application
|
112
|
+
|
113
|
+
application.comment[3]
|
118
114
|
end
|
119
115
|
end
|
120
116
|
end
|
@@ -8,7 +8,7 @@ class UserAgent
|
|
8
8
|
class WindowsMediaPlayer < Base
|
9
9
|
def self.extend?(agent)
|
10
10
|
agent.detect do |useragent|
|
11
|
-
(
|
11
|
+
%w(NSPlayer Windows-Media-Player WMFSDK).include?(useragent.product) &&
|
12
12
|
agent.version != "4.1.0.3856" && # 4.1.0.3856 is libavformat
|
13
13
|
agent.version != "7.10.0.3059" && # used by VLC for mmsh support
|
14
14
|
agent.version != "7.0.0.1956" # used by VLC for mmstu support
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useragent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Peek
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|