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 (
commit c27ace618345fc3d863ce63d76cd347d91c7143c
tree 8c0b48ee70d9dccb777b13b4d4ab55495f6c9c22
parent 51ae3091f313265fce07dd62a3dfb8f36f91f8dd
tree 8c0b48ee70d9dccb777b13b4d4ab55495f6c9c22
parent 51ae3091f313265fce07dd62a3dfb8f36f91f8dd
| 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:34:50 -0700 2009 | |
| |
Rakefile | Wed Nov 11 07:15:13 -0800 2009 | |
| |
lib/ | Wed Nov 11 07:07:30 -0800 2009 | |
| |
spec/ | Wed Nov 11 07:07:30 -0800 2009 | |
| |
useragent.gemspec | Wed Nov 11 07:23:06 -0800 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







