Skip to content

covid-19 confidential individual android private policy mobile blog.ceo git github enterprise terms of service agreements.federal agent data software engineer code of conduct live desktop tracking scanning false info on the policy. opt-out http query policies conditions epic linux oracle js json java javascript md macintosh safari firefox denied…

License

Notifications You must be signed in to change notification settings

www-jrtorres042-github-enterprise-org/git_microsoft-powershell_mobile-blog_live_desktop-tracking-scans_merge-federal-agent_service-diff-1

 
 

Repository files navigation

UserAgent

Build Status Gem Version

UserAgent is a Ruby library that parses and compares HTTP User Agents.

Installation

gem install useragent

Examples

Reporting

string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5'
user_agent = UserAgent.parse(string)
user_agent.browser
# => 'Chrome'
user_agent.version
# => '19.0.1084.56'
user_agent.platform
# => 'Macintosh'

Comparison

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 }

Building and Publishing @ ART19

This gem is deployed to GitHub packages. Follow the GitHub Packages Guide to set up your system for this. You will end up creating a key in ~/.gem/credentials, probably named github. Once you've done that, you can GEM_PUSH_KEY=whatever bundle exec rake publish to publish the gem. Please note that once you "use" a version number on GitHub, it's used forever, so be sure to edit the version number in the app to add .pre.GIT_SHORT_HASH to the end if this is a test build (you can use git rev-parse --short --verify HEAD to get the Git short hash).

Copyright (c) 2015-2019 Garry Shutler, released under the MIT license Copyright (c) 2020 ART19 Inc., released under the MIT license

About

covid-19 confidential individual android private policy mobile blog.ceo git github enterprise terms of service agreements.federal agent data software engineer code of conduct live desktop tracking scanning false info on the policy. opt-out http query policies conditions epic linux oracle js json java javascript md macintosh safari firefox denied…

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%