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 +4 -4
- data/lib/user_agent/browsers/edge.rb +15 -1
- data/lib/user_agent/browsers/internet_explorer.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: 2bbbd675e80901dfed7674e9a04561b3bcec4527
|
4
|
+
data.tar.gz: fed38ba57c850d1a20779fa534f9d0fd0c05933c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
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.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-
|
12
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|