public
Description: HTTP User Agent parser
Homepage:
Clone URL: git://github.com/josh/useragent.git
name age message
file .gitignore Thu Oct 01 08:35:08 -0700 2009 ignore pkg/ dir [josh]
file LICENSE Thu Oct 01 08:21:23 -0700 2009 rename to just LICENSE [josh]
file README Thu Oct 01 08:16:47 -0700 2009 add rdoc extension to readme for better formatting [josh]
file Rakefile Fri Oct 02 15:13:52 -0700 2009 switch to mg publishing tasks [josh]
directory lib/ Thu Oct 01 14:12:01 -0700 2009 add spec for unknown 'Mozilla/4.0 (compatible)'... [josh]
directory spec/ Thu Oct 01 14:13:49 -0700 2009 add spec for IE 8 [josh]
file useragent.gemspec Thu Oct 01 09:33:04 -0700 2009 bump version to 0.1.0 [josh]
README
UserAgent
=========

UserAgent is a Ruby library that parses and compares HTTP User Agents.


Example
=======

  Browser = Struct.new(:browser, :version)
  SupportedBrowsers = [
    Browser.new("Safari", "3.1.1"),
    Browser.new("Firefox", "2.0.0.14"),
    Browser.new("Internet Explorer", "7.0")
  ]

  user_agent = UserAgent.parse(request.user_agent)
  SupportedBrowsers.detect { |browser| user_agent >= browser }


Copyright (c) 2009 Joshua Peek, released under the MIT license