useragent 0.4.3 → 0.4.4

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/opera.rb +12 -4
  2. metadata +10 -5
@@ -6,7 +6,9 @@ class UserAgent
6
6
  end
7
7
 
8
8
  def platform
9
- if application.comment[0] =~ /Windows/
9
+ if application.comment.nil?
10
+ nil
11
+ elsif application.comment[0] =~ /Windows/
10
12
  "Windows"
11
13
  else
12
14
  application.comment[0]
@@ -14,7 +16,9 @@ class UserAgent
14
16
  end
15
17
 
16
18
  def security
17
- if platform == "Macintosh"
19
+ if application.comment.nil?
20
+ :strong
21
+ elsif platform == "Macintosh"
18
22
  Security[application.comment[2]]
19
23
  else
20
24
  Security[application.comment[1]]
@@ -22,7 +26,9 @@ class UserAgent
22
26
  end
23
27
 
24
28
  def os
25
- if application.comment[0] =~ /Windows/
29
+ if application.comment.nil?
30
+ nil
31
+ elsif application.comment[0] =~ /Windows/
26
32
  OperatingSystems.normalize_os(application.comment[0])
27
33
  else
28
34
  application.comment[1]
@@ -30,7 +36,9 @@ class UserAgent
30
36
  end
31
37
 
32
38
  def localization
33
- if platform == "Macintosh"
39
+ if application.comment.nil?
40
+ nil
41
+ elsif platform == "Macintosh"
34
42
  application.comment[3]
35
43
  else
36
44
  application.comment[2]
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useragent
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 7
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 4
8
- - 3
9
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.4
10
11
  platform: ruby
11
12
  authors:
12
13
  - Joshua Peek
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-07-25 00:00:00 -05:00
18
+ date: 2011-09-01 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
@@ -38,6 +40,7 @@ dependencies:
38
40
  requirements:
39
41
  - - ">="
40
42
  - !ruby/object:Gem::Version
43
+ hash: 3
41
44
  segments:
42
45
  - 0
43
46
  version: "0"
@@ -79,6 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
82
  requirements:
80
83
  - - ">="
81
84
  - !ruby/object:Gem::Version
85
+ hash: 3
82
86
  segments:
83
87
  - 0
84
88
  version: "0"
@@ -87,13 +91,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
91
  requirements:
88
92
  - - ">="
89
93
  - !ruby/object:Gem::Version
94
+ hash: 3
90
95
  segments:
91
96
  - 0
92
97
  version: "0"
93
98
  requirements: []
94
99
 
95
100
  rubyforge_project:
96
- rubygems_version: 1.3.7
101
+ rubygems_version: 1.5.2
97
102
  signing_key:
98
103
  specification_version: 3
99
104
  summary: HTTP User Agent parser