useragent 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60229f0393362db45ed2b92cad620f686235643c
4
- data.tar.gz: d435653047931be76f50f5410f65851da9760725
3
+ metadata.gz: 751d90d864d4d4274012b45b1e90926759d7004d
4
+ data.tar.gz: eb86f15579cb8d21ba4475e6f6142b54d8546c1d
5
5
  SHA512:
6
- metadata.gz: a54ad7398cfeabd6906f2bcfdd65c31147cce81749e756e8af646414b8699fdcc79558f9468bcee0c96ff4eda0bac4ec25697995c3eccf362eab7855f4902448
7
- data.tar.gz: 61f588a2a84dd13a0d0fd3add412c136b0ac0f3de29f07741ca3be3475090f76e27c8520e3e4d13865562fd2e018e0de1a1272e5a8e4d54b4cc72d42072ff3fb
6
+ metadata.gz: 5a805566294d8832eb6def73486f653dd371dfe8690de198e772d661deea02f7d654bd8a4e71fd3e152f458ad761a0c8c93995428d206ba9658e9eb6e7bfac35
7
+ data.tar.gz: 24baeef26f95ba6a0af1226f815f7e82b7b22dbd98421099849ed8ea52d9ec9ce370f2f3eca9e9bbb8f9af9a924c0ab920aa3e12050dd9b05e415c8019ff30ce
@@ -51,7 +51,7 @@ class UserAgent
51
51
 
52
52
  include Comparable
53
53
 
54
- # Any comparsion between two user agents with different products will
54
+ # Any comparison between two user agents with different products will
55
55
  # always return false.
56
56
  def <=>(other)
57
57
  if @product == other.product
@@ -9,6 +9,8 @@ require 'user_agent/browsers/windows_media_player'
9
9
  require 'user_agent/browsers/itunes'
10
10
  require 'user_agent/browsers/apple_core_media'
11
11
  require 'user_agent/browsers/libavformat'
12
+ require 'user_agent/browsers/playstation'
13
+ require 'user_agent/browsers/podcast_addict'
12
14
 
13
15
  class UserAgent
14
16
  module Browsers
@@ -19,7 +21,8 @@ class UserAgent
19
21
  }.freeze
20
22
 
21
23
  def self.all
22
- [Edge, InternetExplorer, Opera, Chrome, ITunes, Webkit, Gecko, WindowsMediaPlayer, AppleCoreMedia, Libavformat]
24
+ [Edge, InternetExplorer, Opera, Chrome, ITunes, PlayStation, PodcastAddict, Webkit, Gecko,
25
+ WindowsMediaPlayer, AppleCoreMedia, Libavformat]
23
26
  end
24
27
 
25
28
  def self.extend(array)
@@ -24,7 +24,7 @@ class UserAgent
24
24
 
25
25
  def platform
26
26
  if comment = application.comment
27
- if comment[0] == 'compatible'
27
+ if comment[0] == 'compatible' || comment[0] == 'Mobile'
28
28
  nil
29
29
  elsif /^Windows / =~ comment[0]
30
30
  'Windows'
@@ -41,13 +41,17 @@ class UserAgent
41
41
  def os
42
42
  if comment = application.comment
43
43
  i = if comment[1] == 'U'
44
- 2
45
- elsif /^Windows / =~ comment[0]
46
- 0
47
- else
48
- 1
49
- end
44
+ 2
45
+ elsif /^Windows / =~ comment[0] || /^Android/ =~ comment[0]
46
+ 0
47
+ elsif comment[0] == 'Mobile'
48
+ nil
49
+ else
50
+ 1
51
+ end
50
52
 
53
+ return nil if i.nil?
54
+
51
55
  OperatingSystems.normalize_os(comment[i])
52
56
  end
53
57
  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.15.2
4
+ version: 0.16.0
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: 2015-08-24 00:00:00.000000000 Z
12
+ date: 2015-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake