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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5446d70b87d779a13b4a5b3f132b91a29722d84167fcc2ac9b61a142e7b5a45c
4
- data.tar.gz: ccc2f5bc197c2f7ec72969289989742f3400f69e2a2eb468c001fd994237f2bc
3
+ metadata.gz: b20a9e978f946b59d3d3c9e2ee0b6763948c59278cc839bff63931879e3f18bb
4
+ data.tar.gz: 4dc2f01cbc06e1d60c99fd72211442bddfae47011cae0f237bec5eea12f2dddc
5
5
  SHA512:
6
- metadata.gz: a1b2ab985beac4aef8812c35fcda2707c52fc204c26435d7bf9dd7b33441dc9666739e4a9319e64e1fab31fab8f46d73e7af79c63b14ae21a084f517c0e7f9ea
7
- data.tar.gz: f57a9566ebb142092e574dc0889a636c673342e5a71e5ccc1f111951c4ac1fa78995dbbe090cd2de7d5c3cd073dbecd3999aca06889a3beb5419d72616547090
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 =
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canvas
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
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.0.0
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-07-27 00:00:00.000000000 Z
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.1.6
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: []