useragent 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2754f847309df982314904e199ceb1a2330ee16
4
- data.tar.gz: 9f51e5fd8fa695b019bd689460944a97aa633517
3
+ metadata.gz: 756a613a6bf15fa02a568deedcf0793efe787d94
4
+ data.tar.gz: e26e84bdf913d9f61cb6a9b3cee31534f4661e9b
5
5
  SHA512:
6
- metadata.gz: e1287809659ebbf180b230f8145e11532266db9cd7af33db141f40de75fa459921a68bac3e512ed00fcd3389f845022632ab7733ed42fdc743b6be5133a01f79
7
- data.tar.gz: 3ddbef57e44135b8e83479c2bf4d0e55912e01e4d2d1575e69001c5b5c97054d2d865e1c31fcd9a3064ce09723cb6715e87e0dc2431913f9f3b69e04f590e97a
6
+ metadata.gz: 74bf4b404e15e94574f04636cf6ce784b9df02486c0d69c1652655db492996e1b7426ed6a546deeee27c3222334278845ca7365d8eca8356c24c3ae3b4874d62
7
+ data.tar.gz: d7382d205d07fa86149072d364427bd72cdc847904a06d725eac0c2687abee098ce4d210be0b8c69075ed7278faa9816317211ed8f68ad3ff72871137ace0e4b
@@ -3,9 +3,9 @@ class UserAgent
3
3
  class InternetExplorer < Base
4
4
  def self.extend?(agent)
5
5
  agent.application &&
6
- agent.application.comment &&
7
- agent.application.comment[0] == "compatible" &&
8
- agent.application.comment[1] =~ /MSIE/
6
+ agent.application.comment &&
7
+ (agent.application.comment[1] =~ /MSIE/ ||
8
+ agent.application.comment.join('; ') =~ /Trident.+rv:/)
9
9
  end
10
10
 
11
11
  def browser
@@ -13,15 +13,9 @@ class UserAgent
13
13
  end
14
14
 
15
15
  def version
16
- Version.new(application.comment[1].sub("MSIE ", ""))
17
- end
18
-
19
- def compatibility
20
- application.comment[0]
21
- end
22
-
23
- def compatible?
24
- compatibility == "compatible"
16
+ if version = application.comment.join('; ')[/(MSIE\s|rv:)([\d\.]+)/, 2]
17
+ Version.new(version)
18
+ end
25
19
  end
26
20
 
27
21
  def compatibility_view?
@@ -43,7 +37,7 @@ class UserAgent
43
37
  end
44
38
 
45
39
  def os
46
- OperatingSystems.normalize_os(application.comment[2])
40
+ OperatingSystems.normalize_os(application.comment.join('; ').match(/Windows NT [\d\.]+|Windows Phone OS [\d\.]+/).to_s)
47
41
  end
48
42
  end
49
43
  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.9.0
4
+ version: 0.10.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-10-25 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake