New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loyal_user_agent

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loyal_user_agent

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= UserAgent

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 }

Copyright (c) 2013 Joshua Peek, released under the MIT license

FAQs

Package last updated on 03 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc