useragent 0.4.1 → 0.4.2

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 +10 -5
  2. metadata +3 -3
@@ -21,8 +21,9 @@ class UserAgent
21
21
  end
22
22
 
23
23
  def platform
24
- platform = application.comment[0]
25
- platform == 'compatible' ? nil : platform
24
+ if comment = application.comment
25
+ comment[0] == 'compatible' ? nil : comment[0]
26
+ end
26
27
  end
27
28
 
28
29
  def security
@@ -30,12 +31,16 @@ class UserAgent
30
31
  end
31
32
 
32
33
  def os
33
- i = application.comment[1] == 'U' ? 2 : 1
34
- OperatingSystems.normalize_os(application.comment[i])
34
+ if comment = application.comment
35
+ i = comment[1] == 'U' ? 2 : 1
36
+ OperatingSystems.normalize_os(comment[i])
37
+ end
35
38
  end
36
39
 
37
40
  def localization
38
- application.comment[3]
41
+ if comment = application.comment
42
+ comment[3]
43
+ end
39
44
  end
40
45
  end
41
46
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useragent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Peek