easol-canvas 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas/validators/layout_schema.rb +16 -0
- data/lib/canvas/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b20a9e978f946b59d3d3c9e2ee0b6763948c59278cc839bff63931879e3f18bb
|
4
|
+
data.tar.gz: 4dc2f01cbc06e1d60c99fd72211442bddfae47011cae0f237bec5eea12f2dddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce1b8bab498d701f7ba028879060c7113ae231e59c9eeb2f1efb5d8ec6930043aeb1e6b061a5b121fa7f89ae470520482f8d2521aac7de606c3f2ef45be093e
|
7
|
+
data.tar.gz: cb1d28f8904587f6061ff31914f167cc055bc6bd95eb96f8acd8ff40550e5e2673f4d2386a12cf554f4976d8a5f425453a8e3e9c9ab24260ba05cbdbf93e6c5e
|
@@ -57,6 +57,7 @@ module Canvas
|
|
57
57
|
ensure_no_unrecognized_keys
|
58
58
|
ensure_no_duplicate_keys
|
59
59
|
ensure_accordion_toggles_are_valid
|
60
|
+
ensure_unique_tabs
|
60
61
|
end
|
61
62
|
|
62
63
|
@errors.empty?
|
@@ -66,6 +67,21 @@ module Canvas
|
|
66
67
|
|
67
68
|
attr_reader :schema
|
68
69
|
|
70
|
+
def ensure_unique_tabs
|
71
|
+
tabs = fetch_elements_of_type("tab")
|
72
|
+
duplicates =
|
73
|
+
tabs
|
74
|
+
.map { |item| [item[0]["label"], item[1]] }
|
75
|
+
.group_by { |(key, _)| key }
|
76
|
+
.filter { |key, usage| usage.size > 1 }
|
77
|
+
|
78
|
+
unless duplicates.empty?
|
79
|
+
duplicates.each do |tab, usage|
|
80
|
+
@errors << "Duplicated tab label `#{tab}` found. Location: #{usage.map { |(_, location)| location }.join(", ")}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
69
85
|
def ensure_no_duplicate_keys
|
70
86
|
attributes = fetch_all_attribute_names
|
71
87
|
duplicates =
|
data/lib/canvas/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easol-canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Byrne
|
8
8
|
- Ian Mooney
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -155,7 +155,7 @@ homepage: https://rubygems.org/gems/easol-canvas
|
|
155
155
|
licenses:
|
156
156
|
- MIT
|
157
157
|
metadata: {}
|
158
|
-
post_install_message:
|
158
|
+
post_install_message:
|
159
159
|
rdoc_options: []
|
160
160
|
require_paths:
|
161
161
|
- lib
|
@@ -170,8 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
-
signing_key:
|
173
|
+
rubygems_version: 3.3.11
|
174
|
+
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: CLI to help with building themes for Easol
|
177
177
|
test_files: []
|