useragent 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/user_agent.rb CHANGED
@@ -1,8 +1,8 @@
1
- class UserAgent
2
- autoload :Browsers, 'user_agent/browsers'
3
- autoload :Comparable, 'user_agent/comparable'
4
- autoload :OperatingSystems, 'user_agent/operating_systems'
1
+ require 'user_agent/comparable'
2
+ require 'user_agent/browsers'
3
+ require 'user_agent/operating_systems'
5
4
 
5
+ class UserAgent
6
6
  # http://www.texsoft.it/index.php?m=sw.php.useragent
7
7
  MATCHER = %r{
8
8
  ^([^/\s]+) # Product
@@ -1,11 +1,11 @@
1
+ require 'user_agent/browsers/all'
2
+ require 'user_agent/browsers/gecko'
3
+ require 'user_agent/browsers/internet_explorer'
4
+ require 'user_agent/browsers/opera'
5
+ require 'user_agent/browsers/webkit'
6
+
1
7
  class UserAgent
2
8
  module Browsers
3
- autoload :All, 'user_agent/browsers/all'
4
- autoload :Gecko, 'user_agent/browsers/gecko'
5
- autoload :InternetExplorer, 'user_agent/browsers/internet_explorer'
6
- autoload :Opera, 'user_agent/browsers/opera'
7
- autoload :Webkit, 'user_agent/browsers/webkit'
8
-
9
9
  Security = {
10
10
  "N" => :none,
11
11
  "U" => :strong,
@@ -23,7 +23,14 @@ class UserAgent
23
23
  def compatible?
24
24
  compatibility == "compatible"
25
25
  end
26
-
26
+
27
+ # Before version 4.0, Chrome Frame declared itself (unversioned) in a comment;
28
+ # as of 4.0 it declares itself as a separate product with a version.
29
+
30
+ def chromeframe
31
+ application.comment.include?("chromeframe") || detect_product("chromeframe")
32
+ end
33
+
27
34
  def platform
28
35
  "Windows"
29
36
  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.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-06 00:00:00 -06:00
12
+ date: 2009-12-18 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15