Sha256: 84ac8d888375b0d764a2208e605b18d7434de4b6f404cd96562d9abbc7f78cf7

Contents?: true

Size: 1.26 KB

Versions: 21

Compression:

Stored size: 1.26 KB

Contents

[![Build Status](https://secure.travis-ci.org/Shopify/browser_sniffer.png?branch=master)](http://travis-ci.org/Shopify/browser_sniffer)
[![Gem Version](https://badge.fury.io/rb/browser_sniffer.png)](http://badge.fury.io/rb/browser_sniffer)

# BrowserSniffer

## Description

Parses user agent strings and boils it all down to a few simple classifications.

## Installation

Add this line to your application's Gemfile:

    gem "browser_sniffer"

And then execute:

    $ bundle install

Or install it yourself as:

    $ git clone https://github.com/Shopify/browser_sniffer && cd browser_sniffer && bundle install && rake install

## Usage

```ruby
require "browser_sniffer"

client_info = BrowserSniffer.new(request.user_agent)
client_info.form_factor           # => :tablet
client_info.browser               # => :safari
client_info.major_browser_version # => 4
client_info.engine                # => :webkit
client_info.major_engine_version  # => 531
client_info.os                    # => :ios
client_info.os_version            # => 3.2
```

## Contributing

Fork, branch & pull request.

## Licensing

Based off [UAParser.js](https://github.com/faisalman/ua-parser-js)

Copyright (c) 2013 Shopify  
Copyright (c) 2012-2013 Faisalman <fyzlman@gmail.com>  
Dual licensed under GPLv2 & MIT

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
browser_sniffer-1.4.0 README.md
browser_sniffer-1.3.0 README.md
browser_sniffer-1.2.2 README.md
browser_sniffer-1.2.1 README.md
browser_sniffer-1.2.0 README.md
browser_sniffer-1.1.3 README.md
browser_sniffer-1.1.2 README.md
browser_sniffer-1.1.1 README.md
browser_sniffer-1.1.0 README.md
browser_sniffer-1.0.13 README.md
browser_sniffer-1.0.12 README.md
browser_sniffer-1.0.11 README.md
browser_sniffer-1.0.10 README.md
browser_sniffer-1.0.9 README.md
browser_sniffer-1.0.8 README.md
browser_sniffer-1.0.7 README.md
browser_sniffer-1.0.6 README.md
browser_sniffer-1.0.5 README.md
browser_sniffer-1.0.4 README.md
browser_sniffer-1.0.1 README.md