dugway 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dugway/cli/templates/source/stylesheets/cart.css.sass +1 -1
- data/lib/dugway/theme.rb +21 -10
- data/lib/dugway/version.rb +1 -1
- 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: c3efe750c07138767b6b491f5fd375df42560fa0dd77fd18e3f0bd10578667f5
|
4
|
+
data.tar.gz: 90ab41b88afa8995d7890612ecdd262f0cb2146dfea7c7b1eced3d99bd78744d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 922ee155123b7f98a421bdf5039b707b48defa71a55296ecad5ac96185c587775885b78e4d3534462a52a35f86af23d69094e65df2bbbf58e217f06cbcfd00d6
|
7
|
+
data.tar.gz: 419a042a3b9fffb5d8951b27c06b300d996a95407bf634d988fced33eb3bb8af380eee29e2f157d87d19c045a60e13d3037f196980fb9b0a5c2be535cf14f230
|
data/lib/dugway/theme.rb
CHANGED
@@ -143,7 +143,7 @@ module Dugway
|
|
143
143
|
def validate_required_layout_attributes
|
144
144
|
layout_content = read_source_file('layout.html')
|
145
145
|
|
146
|
-
unless layout_content =~ /<body
|
146
|
+
unless layout_content =~ /<body.*?\bdata-bc-page-type\b/
|
147
147
|
@errors << "layout.html missing `data-bc-page-type` attribute on body tag"
|
148
148
|
end
|
149
149
|
|
@@ -168,30 +168,32 @@ module Dugway
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def validate_preset_styles(preset)
|
171
|
-
@errors << 'Preset is missing group_name'
|
171
|
+
@errors << 'Preset is missing group_name' if preset['group_name'].to_s.strip.empty?
|
172
172
|
@errors << 'Preset is missing styles' unless preset['styles'].is_a?(Array)
|
173
173
|
|
174
174
|
preset['styles'].each do |style|
|
175
|
-
@errors <<
|
175
|
+
@errors << "Style in group '#{preset['group_name']}' - Missing style_name" if style['style_name'].to_s.strip.empty?
|
176
176
|
|
177
177
|
if style['fonts'].is_a?(Hash) && !style['fonts'].empty?
|
178
178
|
style['fonts'].each_value do |font|
|
179
|
-
@errors << '
|
179
|
+
@errors << "Style '#{style['style_name']} - Contains an invalid font name" if font.to_s.strip.empty?
|
180
180
|
end
|
181
181
|
else
|
182
|
-
@errors <<
|
182
|
+
@errors << "Style '#{style['style_name']}' - Missing fonts"
|
183
183
|
end
|
184
184
|
|
185
185
|
if style['colors'].is_a?(Hash) && !style['colors'].empty?
|
186
186
|
style['colors'].each do |key, color|
|
187
|
-
|
187
|
+
unless color =~ /^#[0-9A-Fa-f]{6}$/
|
188
|
+
@errors << "Style '#{style['style_name']}' - Invalid color value '#{color}' for color '#{key}''"
|
189
|
+
end
|
188
190
|
end
|
189
191
|
else
|
190
|
-
@errors <<
|
192
|
+
@errors << "Style '#{style['style_name']}' - Missing required color settings"
|
191
193
|
end
|
192
194
|
end
|
193
195
|
|
194
|
-
|
196
|
+
validate_style_name_uniqueness(preset['styles'])
|
195
197
|
end
|
196
198
|
|
197
199
|
def validate_style_references(preset)
|
@@ -209,11 +211,20 @@ module Dugway
|
|
209
211
|
extra_keys = style_keys - variables
|
210
212
|
missing_keys = variables - style_keys
|
211
213
|
|
212
|
-
@errors << "Extra #{key_type} keys: #{extra_keys.join(', ')}" unless extra_keys.empty?
|
213
|
-
@errors << "Missing #{key_type} keys: #{missing_keys.join(', ')}" unless missing_keys.empty?
|
214
|
+
@errors << "Style '#{style['style_name']}' - Extra #{key_type} keys: #{extra_keys.join(', ')}" unless extra_keys.empty?
|
215
|
+
@errors << "Style '#{style['style_name']}' - Missing #{key_type} keys: #{missing_keys.join(', ')}" unless missing_keys.empty?
|
214
216
|
end
|
215
217
|
end
|
216
218
|
|
219
|
+
def validate_style_name_uniqueness(styles)
|
220
|
+
duplicates = styles
|
221
|
+
.group_by { |s| s['style_name'] }
|
222
|
+
.select { |_, group| group.size > 1 }
|
223
|
+
.keys
|
224
|
+
|
225
|
+
@errors << "Duplicate style names found: #{duplicates.join(', ')}" if duplicates.any?
|
226
|
+
end
|
227
|
+
|
217
228
|
def source_dir
|
218
229
|
Dugway.source_dir
|
219
230
|
end
|
data/lib/dugway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dugway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Big Cartel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|