sewing_kit 0.95.3 → 0.95.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sewing_kit/version.rb +1 -1
- data/lib/sewing_kit/webpack/manifest/production.rb +20 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8847792f430ca9ff0b5d9e2da35b701392636af48ac0435f9e82f816e4d9b385
|
4
|
+
data.tar.gz: cb61d56de21e9ae5e4c937313d2acfc213e10790cb8139c5b3e432ec76759f25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f956eb534703a3b6f1bc57013be323209fec34ff1d34377757067cf42b6364ed399b88e37fa8db81401cc63909c80efebf68077e08cfdfdd7c1c93745d648f3a
|
7
|
+
data.tar.gz: 7dd03739b8f4677e9e5e55834af4481027a4b23a85413bfbdb9d46f7122455956e04a95290ba71378aa056e253c5ee29f19b8f1ed11c178b9c2c0c49e33db6b4
|
data/lib/sewing_kit/version.rb
CHANGED
@@ -43,14 +43,28 @@ module SewingKit
|
|
43
43
|
def find_matching_metadata(consolidated_metadata, user_agent)
|
44
44
|
return metadata unless metadata.is_a?(Array)
|
45
45
|
|
46
|
-
found = consolidated_metadata.find do |
|
47
|
-
|
48
|
-
matcher = BrowserslistUseragent::Match.new(metadata["resolvedBrowsers"], user_agent)
|
49
|
-
|
50
|
-
matcher.browser? && matcher.version?(allow_higher: true)
|
46
|
+
found = consolidated_metadata.find do |metadata_item|
|
47
|
+
metadata_matches?(metadata_item, user_agent)
|
51
48
|
end
|
52
49
|
|
53
|
-
found || consolidated_metadata
|
50
|
+
found || baseline(consolidated_metadata)
|
51
|
+
end
|
52
|
+
|
53
|
+
def metadata_matches?(metadata_item, user_agent)
|
54
|
+
return false if metadata_item["resolvedBrowsers"].nil?
|
55
|
+
|
56
|
+
matcher = BrowserslistUseragent::Match.new(metadata_item["resolvedBrowsers"], user_agent)
|
57
|
+
matcher.browser? && matcher.version?(allow_higher: true)
|
58
|
+
rescue ArgumentError
|
59
|
+
# Some user_agent strings have bad semver versions.
|
60
|
+
# In these cases the Semver gem ends up throwing an ArgumentError when we parse the user_agent.
|
61
|
+
# Since we cannot know what kind of browser the user has when parsing fails,
|
62
|
+
# the safest option is to just return false here and let the defaulting logic send the baseline manifest.
|
63
|
+
false
|
64
|
+
end
|
65
|
+
|
66
|
+
def baseline(consolidated_metadata)
|
67
|
+
consolidated_metadata.last
|
54
68
|
end
|
55
69
|
|
56
70
|
def load_metadata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sewing_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.95.
|
4
|
+
version: 0.95.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Sauve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|