browser_sniffer 2.2.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -2
- data/README.md +1 -1
- data/browser_sniffer.gemspec +1 -1
- data/lib/browser_sniffer/patterns.rb +3 -0
- data/lib/browser_sniffer/version.rb +1 -1
- data/test/shopify_agents_test.rb +19 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bb83754d8d9d227841406041cb455e973554dde6b74a94288ee0e4bc8bce0fb
|
4
|
+
data.tar.gz: 690cb4204124ede02eb0f8d20ecda5a81be5d41e599b8b795fd685d4775eb05b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48984712d0918c8202493f1ace3027ae4f02abfadc092b7102d6c9158e375d0553f4550d87f3a6d8d3b0ad90df98ced731fa02b2edab7b72ce9141120fc335c9
|
7
|
+
data.tar.gz: 5c5b4cf4cac87fbd8e928e5d4ab720660e55d06e0af9175fddf61d7febb2324f7bf5b47855c2586f48f4de17c7190a75ea0b64344dfc74828abce41d2934cf21
|
data/.github/workflows/test.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://github.com/Shopify/browser_sniffer/actions/workflows/test.yml/badge.svg?branch=
|
1
|
+
[![Build Status](https://github.com/Shopify/browser_sniffer/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Shopify/browser_sniffer/actions/workflows/test.yml)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/browser_sniffer.png)](http://badge.fury.io/rb/browser_sniffer)
|
3
3
|
|
4
4
|
# BrowserSniffer
|
data/browser_sniffer.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
-
spec.required_ruby_version = ">=
|
18
|
+
spec.required_ruby_version = ">= 3.0.0"
|
19
19
|
|
20
20
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
21
|
|
@@ -321,6 +321,9 @@ class BrowserSniffer
|
|
321
321
|
], [[:type, :ios], [:version, lambda { |str| str && str.scan(/\d+/).join(".") }], [:name, 'iOS']], [
|
322
322
|
# Shopify Mobile for iPhone or iPad
|
323
323
|
%r{.*(Shopify Mobile)\/(?:iPhone\sOS|iOS)[\/\d\.]* \((iPhone|iPad|iPod).*\/([\d\.]+)\)}i
|
324
|
+
], [[:type, :ios], [:name, 'iOS'], :version], [
|
325
|
+
# Shopify Mobile for iPhone or iPad with build number
|
326
|
+
%r{.*(Shopify Mobile)\/(?:iPhone\sOS|iOS)[\/\d\.]* \((iPhone|iPad|iPod).*\/([\d\.]+) - Build [\d]*\)}i
|
324
327
|
], [[:type, :ios], [:name, 'iOS'], :version], [
|
325
328
|
# Shopify POS Next for iPhone or iPad
|
326
329
|
%r{.*(Shopify POS Next|Shopify POS)\/(?:iPhone\sOS|iOS)[\/\d\.]* \((iPhone|iPad|iPod).*\/([\d\.]+)\)}i
|
data/test/shopify_agents_test.rb
CHANGED
@@ -79,6 +79,25 @@ describe "Shopify agents" do
|
|
79
79
|
version: '12.0.0',
|
80
80
|
name: 'iOS',
|
81
81
|
}), sniffer.os_info
|
82
|
+
|
83
|
+
user_agent = "Shopify Mobile/iOS/9.108.0 (iPhone14,5 Simulator/com.shopify.Shopify/16.4 - Build 225)"
|
84
|
+
sniffer = BrowserSniffer.new(user_agent)
|
85
|
+
|
86
|
+
assert_equal ({
|
87
|
+
name: 'Shopify Mobile',
|
88
|
+
version: '9.108.0',
|
89
|
+
}), sniffer.browser_info
|
90
|
+
|
91
|
+
assert_equal ({
|
92
|
+
type: :handheld,
|
93
|
+
model: '14,5',
|
94
|
+
}), sniffer.device_info
|
95
|
+
|
96
|
+
assert_equal ({
|
97
|
+
type: :ios,
|
98
|
+
version: '16.4',
|
99
|
+
name: 'iOS',
|
100
|
+
}), sniffer.os_info
|
82
101
|
end
|
83
102
|
|
84
103
|
it "Shopify Mobile on iPod touch can be sniffed" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser_sniffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,14 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 3.0.0
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.4
|
100
|
+
rubygems_version: 3.5.4
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Parses user agent strings and boils it all down to a few simple classifications.
|