This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Oct 01 08:35:08 -0700 2009 | |
| |
LICENSE | Thu Oct 01 08:21:23 -0700 2009 | |
| |
README | Thu Oct 01 08:16:47 -0700 2009 | |
| |
Rakefile | Fri Oct 02 15:13:52 -0700 2009 | |
| |
lib/ | Thu Oct 01 14:12:01 -0700 2009 | |
| |
spec/ | Thu Oct 01 14:13:49 -0700 2009 | |
| |
useragent.gemspec | Thu Oct 01 09:33:04 -0700 2009 |
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







