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 (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install josh-useragent
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sun Jul 27 13:06:19 -0700 2008 | [josh] |
| |
README | Sun Jul 27 13:06:19 -0700 2008 | [josh] |
| |
init.rb | Sun Jul 27 13:06:19 -0700 2008 | [josh] |
| |
lib/ | Tue Sep 02 14:31:52 -0700 2008 | [josh] |
| |
spec/ | Tue Sep 02 14:31:52 -0700 2008 | [josh] |
| |
useragent.gemspec | Sun Jul 27 13:10:18 -0700 2008 | [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) 2008 Joshua Peek, released under the MIT license





