useragent 0.4.15 → 0.4.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/user_agent/browsers/gecko.rb +15 -2
  2. metadata +2 -2
@@ -22,7 +22,13 @@ class UserAgent
22
22
 
23
23
  def platform
24
24
  if comment = application.comment
25
- comment[0] == 'compatible' ? nil : comment[0]
25
+ if comment[0] == 'compatible'
26
+ nil
27
+ elsif /^Windows / =~ comment[0]
28
+ 'Windows'
29
+ else
30
+ comment[0]
31
+ end
26
32
  end
27
33
  end
28
34
 
@@ -32,7 +38,14 @@ class UserAgent
32
38
 
33
39
  def os
34
40
  if comment = application.comment
35
- i = comment[1] == 'U' ? 2 : 1
41
+ i = if comment[1] == 'U'
42
+ 2
43
+ elsif /^Windows / =~ comment[0]
44
+ 0
45
+ else
46
+ 1
47
+ end
48
+
36
49
  OperatingSystems.normalize_os(comment[i])
37
50
  end
38
51
  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.4.15
4
+ version: 0.4.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-06 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake