browser_sniffer 2.1.0 → 2.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b1981cafa7ca5c8a1eb77724557e5dc4d6205253bdf658323b9eb18ab9694a1
4
- data.tar.gz: d41f6ccc6071d9c89dd56aa63d618ab42bc10fcafb27ebc15d01d42b489bb14a
3
+ metadata.gz: d021aca2bef95c559cb4c483179018e117859879514a8c3c092e5e4735d157c9
4
+ data.tar.gz: abb3148cea2fb4abb2d457ca3c58299990e2e7e41633d7b2b323e9a169c29ecb
5
5
  SHA512:
6
- metadata.gz: d51befa9a0a988ce65e5a1aa14d9f37c8f67ce88e1b38066c5df3ce333ca052d21221024d9bb559c3113310b077f374367fe545184f510b9e068a3217eb8d690
7
- data.tar.gz: 3b791421e11af2584a89f6984563a9ca7ab3c81d67ff4a0f084440bca90c4b81a5ef0ea5098a2c75b0276e78c8d3ae96e5c6857cc98de6a686663c858f33d4da
6
+ metadata.gz: cd0c1ef575e5d84d86c8b049eea9ff45279d21885b898308378e659dcf1d2bc3d9f9efebe57daf348fe9a5972e334d898f118dfb8defdcd54734db3b1f97b4eb
7
+ data.tar.gz: 6253844664073c0fa4cfc82e7def3fd91c046178410fabd4621fa4275c8e078c1f8e4a05798a6170b87a687ebd62bd94177caee4cb3ee3984b29aadd74ff6d37
@@ -14,16 +14,10 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  version:
17
- - 2.0
18
- - 2.1
19
- - 2.2
20
- - 2.3
21
- - 2.4
22
- - 2.5
23
- - 2.6
24
17
  - 2.7
25
18
  - 3.0
26
19
  - 3.1
20
+ - 3.2
27
21
  - jruby
28
22
  steps:
29
23
  - uses: actions/checkout@v3
@@ -45,6 +45,9 @@ class BrowserSniffer
45
45
  REGEX_MAP = {
46
46
  :browser => [
47
47
  [
48
+ # Shopify POS Go
49
+ /WSC6X|WTH11/i
50
+ ], [[:name, 'Shopify POS Go']],[
48
51
  # Shopify Mobile for iPhone or iPad
49
52
  %r{.*Shopify/\d+\s\((iPhone|iPad)\;\siOS\s[\d\.]+}i
50
53
  ], [[:name, 'Shopify Mobile']], [
@@ -169,6 +172,9 @@ class BrowserSniffer
169
172
  ],
170
173
  :device => [
171
174
  [
175
+ # Shopify POS Go
176
+ /WSC6X|WTH11/i
177
+ ], [[:type, :handheld], [:name, 'Shopify POS Go']],[
172
178
  # Shopify Mobile for iPhone
173
179
  %r{.*Shopify Mobile/(?:iPhone\sOS|iOS)/[\d\.]+ \((iPhone)([\d,]+)}i
174
180
  ], [[:type, :handheld], :model], [
@@ -295,6 +301,9 @@ class BrowserSniffer
295
301
  ],
296
302
  :os => [
297
303
  [
304
+ # Shopify Retail OS on POS Go
305
+ /WSC6X|WTH11/i
306
+ ], [[:name, 'Shopify Retail OS']],[
298
307
  # Shopify Mobile for iOS
299
308
  %r{.*Shopify/\d+\s\((?:iPhone|iPad)\;\s(iOS)\s([\d\.]+)}i
300
309
  ], [[:type, :ios], :version, [:name, 'iOS']], [
@@ -1,3 +1,3 @@
1
1
  class BrowserSniffer
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -1,6 +1,43 @@
1
1
  require "test_helper"
2
2
 
3
3
  describe "Shopify agents" do
4
+
5
+ it "Shopify POS Go can be sniffed with old model name" do
6
+ user_agent = "Mozilla/5.0 (Linux; Android 10; ETNA/29/BBPOS/WSC6X) Chrome"
7
+ sniffer = BrowserSniffer.new(user_agent)
8
+
9
+ assert_equal ({
10
+ name: 'Shopify POS Go',
11
+ }), sniffer.browser_info
12
+
13
+ assert_equal ({
14
+ name: 'Shopify Retail OS',
15
+ }), sniffer.os_info
16
+
17
+ assert_equal ({
18
+ type: :handheld,
19
+ name: 'Shopify POS Go',
20
+ }), sniffer.device_info
21
+ end
22
+
23
+ it "Shopify POS Go can be sniffed with new model name" do
24
+ user_agent = "Mozilla/5.0 (Linux; Android 10; ETNA/29/BBPOS/WTH11) Chrome"
25
+ sniffer = BrowserSniffer.new(user_agent)
26
+
27
+ assert_equal ({
28
+ name: 'Shopify POS Go',
29
+ }), sniffer.browser_info
30
+
31
+ assert_equal ({
32
+ name: 'Shopify Retail OS',
33
+ }), sniffer.os_info
34
+
35
+ assert_equal ({
36
+ type: :handheld,
37
+ name: 'Shopify POS Go',
38
+ }), sniffer.device_info
39
+ end
40
+
4
41
  it "Shopify Mobile on iOS can be sniffed" do
5
42
  user_agent = "Shopify Mobile/iOS/5.4.4 "\
6
43
  "(iPhone9,3/com.jadedpixel.shopify/OperatingSystemVersion(majorVersion: 10, minorVersion: 3, patchVersion: 2))"
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.1.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-16 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.3.3
100
+ rubygems_version: 3.4.19
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.