browserslist_useragent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +16 -0
- data/.travis.yml +7 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +137 -0
- data/Rakefile +10 -0
- data/bin/console +15 -0
- data/bin/setup +6 -0
- data/browserslist_useragent.gemspec +33 -0
- data/lib/browserslist_useragent.rb +8 -0
- data/lib/browserslist_useragent/match.rb +65 -0
- data/lib/browserslist_useragent/query_normalizer.rb +35 -0
- data/lib/browserslist_useragent/resolver.rb +54 -0
- data/lib/browserslist_useragent/version.rb +5 -0
- data/lib/browserslist_useragent/version_normalizer.rb +25 -0
- metadata +160 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 15741b25153c98f5e6574f6de9b3f1540a841baacb5bd08d5a2b8463f3720293
|
4
|
+
data.tar.gz: 4828985519727b646a2cea17342b705029ed2ff27afd592a01a31742f1b53e54
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1280aec42639fa3a8f0c46a22c55d2f522b6698afee2607ac390d96ff2063767f8bf27300b1aff2bdc8a9a0f558f11b3375e6de16806d12f33f1682c25d6f198
|
7
|
+
data.tar.gz: f3c52c63ca90946ceb44cf50f1dee533ba4a661234cec2a0da08b9d76445bbf5c90473deb6fe0684874f75743d52a85c432761e098b843b9716e86b8ed187ad9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Salahutdinov Dmitry
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
# browserslist_useragent gem [](https://travis-ci.org/browserslist/browserslist-useragent-ruby)
|
2
|
+
|
3
|
+
<img align="right" width="120" height="120"
|
4
|
+
src="https://github.com/browserslist/browserslist/blob/master/logo.svg" alt="Browserslist logo by Anton Lovchikov">
|
5
|
+
|
6
|
+
Find if a given user agent string satisfies a [Browserslist](https://github.com/ai/browserslist) browsers.
|
7
|
+
|
8
|
+
[Browserslist](https://github.com/browserslist/browserslist) is a popular config in many front-end tools like [Autoprefixer](https://github.com/postcss/autoprefixer) or [Babel](https://github.com/babel/babel/tree/master/packages/babel-preset-env). This gem allow you to use this config in Ruby project to check user agent string and, for examplle, show “Your browsers is outdated” warning for user with old browser.
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
### 1. Setup Browserslist
|
13
|
+
|
14
|
+
Run in webpack directory to install `browserslist` npm package:
|
15
|
+
|
16
|
+
```sh
|
17
|
+
npm install --save-dev browserslist
|
18
|
+
```
|
19
|
+
|
20
|
+
Put this lines of code to webpack config to generate `browsers.json` during build step:
|
21
|
+
|
22
|
+
```javascript
|
23
|
+
const browserslist = require('browserslist')
|
24
|
+
const fs = require('fs')
|
25
|
+
|
26
|
+
fs.writeFileSync('./browsers.json', JSON.stringify(browserslist()))
|
27
|
+
```
|
28
|
+
|
29
|
+
Put `browsers.js` file to `.gitignore`.
|
30
|
+
|
31
|
+
### 2. Install gem
|
32
|
+
|
33
|
+
Add this line to `Gemfile`
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
gem 'browserslist_useragent'
|
37
|
+
```
|
38
|
+
|
39
|
+
Run `bundle install`.
|
40
|
+
|
41
|
+
### 3. Add helper
|
42
|
+
|
43
|
+
Define new helper in `app/helpers/application_helper.rb`:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
def outdated_browser?
|
47
|
+
@browsers ||= JSON.parse(File.read(PATH_TO_BROWSERS_JSON))
|
48
|
+
matcher = BrowserslistUseragent::Match.new(@browsers, request.user_agent)
|
49
|
+
matcher.browser? && !matcher.version?(allow_higher: true)
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
### 4. Use helper in template
|
54
|
+
|
55
|
+
Put some text for user with outdated browser in `app/views/layout` and add this check in application layout:
|
56
|
+
|
57
|
+
```haml
|
58
|
+
body
|
59
|
+
- if outdated_browser?
|
60
|
+
render 'outdated_browser_warning'
|
61
|
+
```
|
62
|
+
|
63
|
+
### Separated projects
|
64
|
+
|
65
|
+
If you have separated projects for Ruby backend and Node.js frontend, you will prefer to get `browsers.json` over HTTP.
|
66
|
+
|
67
|
+
```javascript
|
68
|
+
fs.writeFileSync(
|
69
|
+
path.join(__dirname, 'public', 'browsers.json'),
|
70
|
+
JSON.stringify(browserslist(undefined, { path: path.join(__dirname, '..') }))
|
71
|
+
)
|
72
|
+
```
|
73
|
+
|
74
|
+
Gets `browserslist.json` over HTTP (with caching) once (per web application instance) and use it to match user agent for every request:
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
# caches http response locally with etag
|
78
|
+
http_client = Faraday.new do |builder|
|
79
|
+
builder.use Faraday::HttpCache, store: Rails.cache
|
80
|
+
builder.adapter Faraday.default_adapter
|
81
|
+
end
|
82
|
+
|
83
|
+
@browsers = JSON.parse(
|
84
|
+
http_client.get(FRONTEND_HOST + '/browsers.json').body
|
85
|
+
)
|
86
|
+
```
|
87
|
+
|
88
|
+
## API
|
89
|
+
`BrowserslistUseragent::Match` is the main class performing matching user agent string to browserslist.
|
90
|
+
|
91
|
+
It provides 2 methods:
|
92
|
+
- `version?(allow_higher: false)` - determines matching browser and it's version
|
93
|
+
- `browser?` - determines matching only borwser family
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'browserslist_useragent'
|
97
|
+
|
98
|
+
matcher = BrowserslistUseragent::Match.new(
|
99
|
+
['Firefox 53'],
|
100
|
+
'Mozilla/5.0 (Windows NT 10.0; rv:54.0) Gecko/20100101 Firefox/53.0'
|
101
|
+
)
|
102
|
+
matcher.browser? # returns true
|
103
|
+
matcher.version? # return true
|
104
|
+
|
105
|
+
matcher = BrowserslistUseragent::Match.new(
|
106
|
+
['Firefox 54'],
|
107
|
+
'Mozilla/5.0 (Windows NT 10.0; rv:54.0) Gecko/20100101 Firefox/53.0'
|
108
|
+
)
|
109
|
+
matcher.browser? # returns true
|
110
|
+
matcher.version? # return false
|
111
|
+
```
|
112
|
+
|
113
|
+
## Supported browsers
|
114
|
+
|
115
|
+
Chrome, Firefox, Safari, IE, Edge
|
116
|
+
|
117
|
+
PRs to add more _browserslist supported_ browsers are welcome 👋
|
118
|
+
|
119
|
+
## Notes
|
120
|
+
|
121
|
+
* All browsers on iOS (Chrome, Firefox etc) use Safari's WebKit as the underlying engine, and hence will be resolved to Safari. Since `browserslist` is usually used for
|
122
|
+
transpiling / autoprefixing for browsers, this behaviour is what's intended in most cases, but might surprise you otherwise.
|
123
|
+
* Right now, Chrome for Android and Firefox for Android are resolved to their desktop equivalents. The `caniuse` database does not currently store historical data for these browsers separately (except the last version) See [#156](https://github.com/ai/browserslist/issues/156)
|
124
|
+
|
125
|
+
## Development
|
126
|
+
|
127
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
128
|
+
|
129
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
130
|
+
|
131
|
+
## Contributing
|
132
|
+
|
133
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/browserslist-useragent-ruby.
|
134
|
+
|
135
|
+
## License
|
136
|
+
|
137
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'browserslist_useragent'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path('lib', __dir__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'browserslist_useragent/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'browserslist_useragent'
|
8
|
+
spec.version = BrowserslistUseragent::VERSION
|
9
|
+
spec.authors = ['Salahutdinov Dmitry']
|
10
|
+
spec.email = ['dsalahutdinov@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Find if a given user agent string satisfies a browserslist query.'
|
13
|
+
spec.description = 'Provides easy way to match browser user agent string with specified set of rules (from browserslist tool)'
|
14
|
+
spec.homepage = 'https://github.com/dsalahutdinov/browserlist-useragent-ruby'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_runtime_dependency 'semantic'
|
25
|
+
spec.add_runtime_dependency 'user_agent_parser'
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
28
|
+
spec.add_development_dependency 'byebug'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 0.55'
|
33
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'browserslist_useragent/version'
|
4
|
+
|
5
|
+
require 'browserslist_useragent/version_normalizer'
|
6
|
+
require 'browserslist_useragent/query_normalizer'
|
7
|
+
require 'browserslist_useragent/match'
|
8
|
+
require 'browserslist_useragent/resolver'
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'semantic'
|
4
|
+
|
5
|
+
module BrowserslistUseragent
|
6
|
+
# Checks matching of browserslist queies array to the user agent string
|
7
|
+
class Match
|
8
|
+
attr_reader :queries, :user_agent_string
|
9
|
+
|
10
|
+
def initialize(queries, user_agent_string)
|
11
|
+
@user_agent_string = user_agent_string
|
12
|
+
@queries = queries.each_with_object({}) do |query, hash|
|
13
|
+
query = BrowserslistUseragent::QueryNormalizer.new(query).call
|
14
|
+
family = query[:family].downcase
|
15
|
+
hash[family] ||= []
|
16
|
+
hash[family].push(query[:version])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def version?(allow_higher: false)
|
21
|
+
return false unless browser?
|
22
|
+
|
23
|
+
user_agent_version = user_agent[:version]
|
24
|
+
return false if user_agent_version.nil? || user_agent_version == ''
|
25
|
+
|
26
|
+
semantic = Semantic::Version.new(user_agent[:version])
|
27
|
+
match_semantic_version(semantic, allow_higher: allow_higher)
|
28
|
+
end
|
29
|
+
|
30
|
+
def browser?
|
31
|
+
target_browser = user_agent[:family].downcase
|
32
|
+
queries.key?(target_browser)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def user_agent
|
38
|
+
Resolver.new(user_agent_string).call
|
39
|
+
end
|
40
|
+
|
41
|
+
def match_semantic_version(semantic, allow_higher:)
|
42
|
+
queries[user_agent[:family].downcase].any? do |version|
|
43
|
+
if allow_higher
|
44
|
+
match_higher_version?(semantic, version)
|
45
|
+
else
|
46
|
+
match_version?(semantic, version)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def match_version?(semantic, query_version)
|
52
|
+
if query_version.include?('-')
|
53
|
+
low_version, high_version = query_version.split('-', 2)
|
54
|
+
semantic.satisfied_by?([">= #{low_version}", "<= #{high_version}"])
|
55
|
+
else
|
56
|
+
semantic.satisfies?(query_version)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def match_higher_version?(semantic, query_version)
|
61
|
+
low_version = query_version.split('-', 2).first
|
62
|
+
semantic.satisfies?(">= #{low_version}")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BrowserslistUseragent
|
4
|
+
# Normalizes browserslist query to existing browser family names
|
5
|
+
class QueryNormalizer
|
6
|
+
NORMALIZED_NAMES = {
|
7
|
+
bb: 'BlackBerry',
|
8
|
+
and_chr: 'Chrome',
|
9
|
+
ChromeAndroid: 'Chrome',
|
10
|
+
FirefoxAndroid: 'Firefox',
|
11
|
+
ff: 'Firefox',
|
12
|
+
ie: 'Explorer',
|
13
|
+
ie_mob: 'ExplorerMobile',
|
14
|
+
and_ff: 'Firefox',
|
15
|
+
ios_saf: 'iOS',
|
16
|
+
op_mini: 'OperaMini',
|
17
|
+
op_mob: 'OperaMobile',
|
18
|
+
and_qq: 'QQAndroid',
|
19
|
+
and_uc: 'UCAndroid'
|
20
|
+
}.freeze
|
21
|
+
|
22
|
+
attr_reader :query
|
23
|
+
|
24
|
+
def initialize(query)
|
25
|
+
@query = query
|
26
|
+
end
|
27
|
+
|
28
|
+
def call
|
29
|
+
browser_name, browser_version = query.split(' ', 2)
|
30
|
+
normalized_name = NORMALIZED_NAMES[browser_name.to_sym] || browser_name
|
31
|
+
|
32
|
+
{ family: normalized_name, version: browser_version }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop: disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
4
|
+
# rubocop: disable Metrics/MethodLength, Metrics/PerceivedComplexity
|
5
|
+
module BrowserslistUseragent
|
6
|
+
# Resolves uaser agent string to {family, version} hash
|
7
|
+
class Resolver
|
8
|
+
attr_reader :user_agent_string
|
9
|
+
|
10
|
+
def initialize(user_agent_string)
|
11
|
+
@user_agent_string = user_agent_string
|
12
|
+
end
|
13
|
+
|
14
|
+
def call
|
15
|
+
agent = UserAgentParser.parse(user_agent_string)
|
16
|
+
|
17
|
+
family = agent.family
|
18
|
+
version = VersionNormalizer.new(agent.version.to_s).call
|
19
|
+
|
20
|
+
# Case A: For Safari, Chrome and others browsers
|
21
|
+
# that report as Safari after stripping tags
|
22
|
+
family = 'iOS' if agent.family.include?('Safari')
|
23
|
+
|
24
|
+
# Case B: The browser on iOS didn't report as safari,
|
25
|
+
# so we use the iOS version as a proxy to the browser
|
26
|
+
# version. This is based on the assumption that the
|
27
|
+
# underlying Safari Engine used will be *atleast* equal
|
28
|
+
# to the iOS version it's running on.
|
29
|
+
if agent.os.family == 'iOS'
|
30
|
+
return {
|
31
|
+
family: 'iOS',
|
32
|
+
version: VersionNormalizer.new(agent.os.version.to_s).call
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Case C: The caniuse database does not contain
|
37
|
+
# historical browser versions for so called `minor`
|
38
|
+
# browsers like Chrome for Android, Firefox for Android etc
|
39
|
+
# In this case, we proxy to the desktop version
|
40
|
+
# @see https://github.com/Fyrd/caniuse/issues/3518
|
41
|
+
family = 'Chrome' if agent.family.include?('Chrome Mobile')
|
42
|
+
|
43
|
+
family = 'Firefox' if agent.family == 'Firefox Mobile'
|
44
|
+
family = 'Explorer' if agent.family == 'IE'
|
45
|
+
family = 'ExplorerMobile' if agent.family == 'IE Mobile'
|
46
|
+
family = 'QQAndroid' if agent.family == 'QQ Browser Mobile'
|
47
|
+
family = 'UCAndroid' if agent.family == 'UC Browser'
|
48
|
+
|
49
|
+
{ family: family, version: version }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
# rubocop: enable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
54
|
+
# rubocop: enable Metrics/MethodLength, Metrics/PerceivedComplexity
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'user_agent_parser'
|
4
|
+
|
5
|
+
module BrowserslistUseragent
|
6
|
+
# Normalizes user agent version to semantically valid state
|
7
|
+
class VersionNormalizer
|
8
|
+
attr_reader :version
|
9
|
+
|
10
|
+
def initialize(version)
|
11
|
+
@version = version
|
12
|
+
end
|
13
|
+
|
14
|
+
def call
|
15
|
+
agent_version = ::UserAgentParser::Version.new(version)
|
16
|
+
return nil if agent_version.major.nil?
|
17
|
+
|
18
|
+
[
|
19
|
+
agent_version.major,
|
20
|
+
agent_version.minor || 0,
|
21
|
+
agent_version.patch || 0
|
22
|
+
].join('.')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: browserslist_useragent
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Salahutdinov Dmitry
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-05-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: semantic
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: user_agent_parser
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.16'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.16'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.55'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.55'
|
111
|
+
description: Provides easy way to match browser user agent string with specified set
|
112
|
+
of rules (from browserslist tool)
|
113
|
+
email:
|
114
|
+
- dsalahutdinov@gmail.com
|
115
|
+
executables: []
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- Gemfile
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/console
|
128
|
+
- bin/setup
|
129
|
+
- browserslist_useragent.gemspec
|
130
|
+
- lib/browserslist_useragent.rb
|
131
|
+
- lib/browserslist_useragent/match.rb
|
132
|
+
- lib/browserslist_useragent/query_normalizer.rb
|
133
|
+
- lib/browserslist_useragent/resolver.rb
|
134
|
+
- lib/browserslist_useragent/version.rb
|
135
|
+
- lib/browserslist_useragent/version_normalizer.rb
|
136
|
+
homepage: https://github.com/dsalahutdinov/browserlist-useragent-ruby
|
137
|
+
licenses:
|
138
|
+
- MIT
|
139
|
+
metadata: {}
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options: []
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 2.7.6
|
157
|
+
signing_key:
|
158
|
+
specification_version: 4
|
159
|
+
summary: Find if a given user agent string satisfies a browserslist query.
|
160
|
+
test_files: []
|