Detect browser, os and platform based upon user agent
Add this line to your application's Gemfile:
gem 'detect_user_agent'
And then execute:
$ bundle
Or install it yourself as:
$ gem install detect_user_agent
DetectUserAgent.parse("Mozilla/5.0 (BB10; <Device Model>) AppleWebKit/<WebKit Version> (KHTML, like Gecko) Version/<BB Version #> Mobile Safari/<WebKit Version>")
returns a hash:
{
platform: 'phone',
os: 'blackberry'
browser: 'blackberry'
}
- Fork it ( https://github.com/[my-github-username]/detect_user_agent/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request