No release in over 3 years
Low commit activity in last 3 years
DeviceDetectorRegexes is an extension for device_detector gem that makes it easy to add new regular expressions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

DeviceDetectorRegexes

DeviceDetectorRegexes is a simple extender for device_detector gem that makes it easy to add new regular expressions

Installation

Add this line to your application's Gemfile:

gem 'device_detector_regexes'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install device_detector_regexes

Usage

Map device_detector regexes folder into your custom folder

DeviceDetector.configure do |config|
  config.dir = "path/to/your/custom/folder"
end

Add new regexes to the appropriate file

# your/custom/folder/regexes/client/mobile_apps.yml

# [] # leave an empty array here if the file is empty
- regex: 'Foo(?:[ /]([\d\.]+))'
  name: 'Bar'
  version: '$1'
  prefix: false # do not append piwik dd prefix
client = DeviceDetector.new("Foo/2.1.2; Android: 9; Model:PAR-LX1; okhttp/3.12.8")
client.name         # => "Bar"
client.full_version # => "2.1.2"

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the DeviceDetectorRegexes project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.