kennel 2.25.1 → 2.25.2
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 +4 -4
- data/lib/kennel/api.rb +5 -4
- data/lib/kennel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0888c55ea45e4debe5ed5b0b0cbad53c8a74f059c6f6146e7bcabeadfef874c4'
|
|
4
|
+
data.tar.gz: ed85f0fbc25f9dbe0d85e1f85be72415b366e36edf44c709fe2d5d0de832abd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ce84eb15e7fd896519872aecc9df8a9ffe6a0b974fd84bac481d1703f76aea29f193741d6f445a7c76a6ce02b616470a33d060830b9c010328691141bfc98f1
|
|
7
|
+
data.tar.gz: 952d833b9c7eecff08831df9db718d15aab9c520ea997b06daf843a63f2f7c91a29f4604916debd3b5d6f22b845f89cfc46d1867775fe1c52fa3a15214ba907b
|
data/lib/kennel/api.rb
CHANGED
|
@@ -123,12 +123,13 @@ module Kennel
|
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
# yield each widget with a key built from its group optional title and its own title
|
|
126
|
-
# untitled widgets (e.g. images) are keyed by their
|
|
127
|
-
#
|
|
126
|
+
# untitled widgets (e.g. images) are keyed by their url or content, their other attributes are
|
|
127
|
+
# randomly changed by the UI and positions change when widgets are reordered
|
|
128
|
+
# widgets with no stable key are matched by position as a last resort
|
|
128
129
|
def each_widget_with_title(widgets, prefix: nil, &block)
|
|
129
|
-
widgets.
|
|
130
|
+
widgets.each_with_index do |widget, index|
|
|
130
131
|
title = widget.dig(:definition, :title)
|
|
131
|
-
title = (
|
|
132
|
+
title = widget.dig(:definition, :url) || widget.dig(:definition, :content) || index if title.to_s.empty?
|
|
132
133
|
key = prefix ? [prefix, title] : [title]
|
|
133
134
|
yield key, widget
|
|
134
135
|
if (nested = widget.dig(:definition, :widgets))
|
data/lib/kennel/version.rb
CHANGED