browser_sniffer 2.2.0 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87fd7513d9ddecf43413cb15db9be18169098ae928add5cc349ca34e63b8c15f
4
- data.tar.gz: c89dd2837067fb3b13d20c47c224dd45b9f144e38a14f6bea77805be2efbc0b1
3
+ metadata.gz: 9969d00aafaee38b0b21cff940ce3a1881251f04da9aa018d52418a186999071
4
+ data.tar.gz: a015ebec601deaa7523287eef8016cdca7318cfe37c45c76a27d7934b640f289
5
5
  SHA512:
6
- metadata.gz: f0c451290816fb66e80c1239831aacd3190d447d094cbd0088586c1ba499d4f34109ccd03c4e3491a8c5ff4a2358caada40713a9b2fa54e02d761aa92c337c02
7
- data.tar.gz: b559ca30a3cf3cf015a7235cc92f0856b83b091d11c52bc86b04895b455e4cbae211d295127e9f951a6827740b09edbd2f65f6ebab2205ba0cf2aa2ad5c01548
6
+ metadata.gz: fdd1f9fdfe2111cdedd9c71af2ed23303d38d12535f005814a825b89db078e5e5cbc1bc22c0d7167a6b607ce63b658e6be72522b2d3676ccbe5141006af5894a
7
+ data.tar.gz: 8750a8aa2954195f77c94dd909058efa54b45964ca5c6ef4462a439068ecd230034d0a1a23be0a6c20f5f6f74ad045ca88d7c69ee926f6f6a4fc6534aa3accbf
@@ -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
@@ -46,7 +46,7 @@ class BrowserSniffer
46
46
  :browser => [
47
47
  [
48
48
  # Shopify POS Go
49
- /WSC6X|WTH1X/i
49
+ /WSC6X|WTH11/i
50
50
  ], [[:name, 'Shopify POS Go']],[
51
51
  # Shopify Mobile for iPhone or iPad
52
52
  %r{.*Shopify/\d+\s\((iPhone|iPad)\;\siOS\s[\d\.]+}i
@@ -173,7 +173,7 @@ class BrowserSniffer
173
173
  :device => [
174
174
  [
175
175
  # Shopify POS Go
176
- /WSC6X|WTH1X/i
176
+ /WSC6X|WTH11/i
177
177
  ], [[:type, :handheld], [:name, 'Shopify POS Go']],[
178
178
  # Shopify Mobile for iPhone
179
179
  %r{.*Shopify Mobile/(?:iPhone\sOS|iOS)/[\d\.]+ \((iPhone)([\d,]+)}i
@@ -302,7 +302,7 @@ class BrowserSniffer
302
302
  :os => [
303
303
  [
304
304
  # Shopify Retail OS on POS Go
305
- /WSC6X|WTH1X/i
305
+ /WSC6X|WTH11/i
306
306
  ], [[:name, 'Shopify Retail OS']],[
307
307
  # Shopify Mobile for iOS
308
308
  %r{.*Shopify/\d+\s\((?:iPhone|iPad)\;\s(iOS)\s([\d\.]+)}i
@@ -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
@@ -1,3 +1,3 @@
1
1
  class BrowserSniffer
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -21,7 +21,7 @@ describe "Shopify agents" do
21
21
  end
22
22
 
23
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/WTH1X) Chrome"
24
+ user_agent = "Mozilla/5.0 (Linux; Android 10; ETNA/29/BBPOS/WTH11) Chrome"
25
25
  sniffer = BrowserSniffer.new(user_agent)
26
26
 
27
27
  assert_equal ({
@@ -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.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-12-05 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.22
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.