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.rdoc | Sun Dec 06 10:38:57 -0800 2009 | |
| |
Rakefile | Sun Dec 06 10:18:41 -0800 2009 | |
| |
lib/ | Fri Dec 18 07:05:43 -0800 2009 | |
| |
spec/ | Fri Dec 18 01:30:17 -0800 2009 | |
| |
useragent.gemspec | Fri Dec 18 07:06:53 -0800 2009 |
README.rdoc
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 © 2009 Joshua Peek, released under the MIT license







