useragent 0.16.2 → 0.16.3
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/internet_explorer.rb +19 -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: c20bcc2861b91b9daa438d2a1c436dc5b8904623
|
4
|
+
data.tar.gz: 05f1418f81ef79ea1388800f2f2b10d6e365035b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b57837939d11ece3dc65209dca3d667390737a44f700af5d2533c2127731a5ed4a18dd7243a491a67a95bf38ddbf2a38cb98dad62e508a17d2bd4c0bc625298
|
7
|
+
data.tar.gz: 0ea1c78533a067e7833bdd57d3e652b12a634b61aea529d1ab3cec8a1c0c5c08d69d82a76cd1c22f5830613e61cc1e02e16f74f1ee8a5090396caff6cde5fbee
|
@@ -1,6 +1,13 @@
|
|
1
1
|
class UserAgent
|
2
2
|
module Browsers
|
3
3
|
class InternetExplorer < Base
|
4
|
+
TRIDENT_ENGINES = {
|
5
|
+
"Trident/7.0" => "11.0",
|
6
|
+
"Trident/6.0" => "10.0",
|
7
|
+
"Trident/5.0" => "9.0",
|
8
|
+
"Trident/4.0" => "8.0",
|
9
|
+
}.freeze
|
10
|
+
|
4
11
|
def self.extend?(agent)
|
5
12
|
agent.application &&
|
6
13
|
agent.application.comment &&
|
@@ -17,8 +24,19 @@ class UserAgent
|
|
17
24
|
Version.new(str)
|
18
25
|
end
|
19
26
|
|
27
|
+
def trident_version
|
28
|
+
if trident = application.comment.detect { |c| c['Trident/'] }
|
29
|
+
trident_version = TRIDENT_ENGINES.fetch(trident, trident)
|
30
|
+
Version.new(trident_version)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def real_version
|
35
|
+
[trident_version, version].sort.last
|
36
|
+
end
|
37
|
+
|
20
38
|
def compatibility_view?
|
21
|
-
version
|
39
|
+
version < real_version
|
22
40
|
end
|
23
41
|
|
24
42
|
# Before version 4.0, Chrome Frame declared itself (unversioned) in a comment;
|
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.3
|
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: 2015-
|
12
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|