useragent 0.16.5 → 0.16.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2968c2152b43a75d824f8f92798fa67f326ddc57
4
- data.tar.gz: 44921683e65eff66400facf87f263f9d1ce47a7b
3
+ metadata.gz: 2bbbd675e80901dfed7674e9a04561b3bcec4527
4
+ data.tar.gz: fed38ba57c850d1a20779fa534f9d0fd0c05933c
5
5
  SHA512:
6
- metadata.gz: b19c3b33e5055a7ada639af7934857483e0c9c2144d1542d68e538972219c0f735d86f19f2218cfde55edc3a74a8651c20791dfb6856bc0fef54da2e1b721418
7
- data.tar.gz: 250804547eb7ac0dfaca4e78a6b3ebe54f28ea336e39bdf6b0de14ae3492161d445299ec158dc4db522fc01f055ed21930d40bb6d7704cabd74a7801288998cd
6
+ metadata.gz: d305a8d8cde309eb2b7072728b844ea10737b2cc96501e9fad8b55c1c031d709fcef24cdc3bb18d36f3711d3a47d0dc0f2d574c7fc5ba77065c421e2b33783d3
7
+ data.tar.gz: 720838b4801bf39f4dd838289a7687cf7710c27c70d875621d26937f1d1b9798ced57d419b52fae34c0ceca09bfe0c6c4b7162f798be0c484d8f862935cdbbcb
@@ -1,6 +1,8 @@
1
1
  class UserAgent
2
2
  module Browsers
3
3
  class Edge < Base
4
+ OS_REGEXP = /Windows NT [\d\.]+|Windows Phone (OS )?[\d\.]+/
5
+
4
6
  def self.extend?(agent)
5
7
  agent.last && agent.last.product == "Edge"
6
8
  end
@@ -18,7 +20,19 @@ class UserAgent
18
20
  end
19
21
 
20
22
  def os
21
- OperatingSystems.normalize_os(application.comment.join('; ').match(/Windows NT [\d\.]+|Windows Phone (OS )?[\d\.]+/).to_s)
23
+ OperatingSystems.normalize_os(os_comment)
24
+ end
25
+
26
+ private
27
+
28
+ def os_comment
29
+ if os_agent = detect { |useragent| comment_os_match(useragent) }
30
+ comment_os_match(os_agent).to_s
31
+ end
32
+ end
33
+
34
+ def comment_os_match(useragent)
35
+ useragent.comment && useragent.comment.join("; ").match(OS_REGEXP)
22
36
  end
23
37
  end
24
38
  end
@@ -37,7 +37,7 @@ class UserAgent
37
37
  end
38
38
 
39
39
  def compatibility_view?
40
- version < real_version
40
+ trident_version && version < real_version
41
41
  end
42
42
 
43
43
  # 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.5
4
+ version: 0.16.6
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: 2016-02-26 00:00:00.000000000 Z
12
+ date: 2016-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake