useragent 0.6.0 → 0.7.0
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/opera.rb +10 -0
- data/lib/user_agent/browsers/webkit.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0120f69b4e121786db5270652b47b8533658243
|
4
|
+
data.tar.gz: e2cff433dd5079b86067608f059db2a044ff1e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11de96864692a2eac9e6df71bf87d61ddba15875bc6673513c8f901447bb3e96bd1e5837f3fce4fd5c3264c02c40d0ee010ee3af6d113cf09d276057e94bda5f
|
7
|
+
data.tar.gz: 1146610d2c06d901ddd4bb51728253e2d18e6c4fe75cf26be0ebebd707c08cf4e161fa56ae436867f8f82f333a359eb3ea06b9d4e92e1ce389cbd1458fb79ef4
|
@@ -28,11 +28,21 @@ class UserAgent
|
|
28
28
|
:strong
|
29
29
|
elsif platform == "Macintosh"
|
30
30
|
Security[application.comment[2]]
|
31
|
+
elsif mini?
|
32
|
+
Security[application.comment[-2]]
|
31
33
|
else
|
32
34
|
Security[application.comment[1]]
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
38
|
+
def mini?
|
39
|
+
/Opera Mini/ === application
|
40
|
+
end
|
41
|
+
|
42
|
+
def mobile?
|
43
|
+
mini?
|
44
|
+
end
|
45
|
+
|
36
46
|
def os
|
37
47
|
if application.comment.nil?
|
38
48
|
nil
|
@@ -10,7 +10,7 @@ class UserAgent
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def browser
|
13
|
-
if detect_product('Chrome')
|
13
|
+
if detect_product('Chrome') || detect_product("CriOS")
|
14
14
|
'Chrome'
|
15
15
|
elsif os =~ /Android/
|
16
16
|
'Android'
|
@@ -60,12 +60,16 @@ class UserAgent
|
|
60
60
|
|
61
61
|
# Prior to Safari 3, the user agent did not include a version number
|
62
62
|
def version
|
63
|
-
str = if os =~ /CPU (?:iPhone |iPod )?OS ([\d_]+) like Mac OS X/
|
63
|
+
str = if os =~ /CPU (?:iPhone |iPod )?OS ([\d_]+) like Mac OS X/ && browser == "Safari"
|
64
64
|
$1.gsub(/_/, '.')
|
65
65
|
elsif product = detect_product('Version')
|
66
66
|
product.version
|
67
67
|
elsif browser == 'Chrome'
|
68
|
-
chrome
|
68
|
+
if detect_product("chrome")
|
69
|
+
chrome.version
|
70
|
+
elsif detect_product("crios")
|
71
|
+
crios.version
|
72
|
+
end
|
69
73
|
else
|
70
74
|
BuildVersions[build.to_s]
|
71
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useragent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Peek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.0.
|
80
|
+
rubygems_version: 2.0.3
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: HTTP User Agent parser
|