lookbook 0.8.2 → 0.8.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da304532fa0dd06355ed74fa190827c04ed8f1dd07953e0db2e12469a61555dc
|
4
|
+
data.tar.gz: ab65b3585a8eed51792f6fc1ec561a85f2f2a1b7884a949e65b4dddb2d6f8fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 374b7c82c964772437bede3b57659e9f39d8804c4325ce193ee8d9566c9547b1e041869b9c8efa3a826077449e00cf768a7280d17001d775526a6417f2bbb46e
|
7
|
+
data.tar.gz: b1c6e3fc74365adbaf37f82cce0d5cf3caec5b9be1ca89a9870a9503b15ae43e2f7d8503dd63b43a4fd3d67eb50c1df137a92b06c7c8b0268c922f02afe2d31c
|
@@ -28,8 +28,8 @@ module Lookbook
|
|
28
28
|
begin
|
29
29
|
set_params
|
30
30
|
@examples = examples_data
|
31
|
-
@drawer_panels = drawer_panels.
|
32
|
-
@preview_panels = preview_panels.
|
31
|
+
@drawer_panels = drawer_panels.select { |name, panel| panel[:show] }
|
32
|
+
@preview_panels = preview_panels.select { |name, panel| panel[:show] }
|
33
33
|
rescue => exception
|
34
34
|
render_in_layout "lookbook/error", error: prettify_error(exception)
|
35
35
|
end
|
@@ -133,7 +133,7 @@ module Lookbook
|
|
133
133
|
template: "lookbook/previews/panels/notes",
|
134
134
|
hotkey: "n",
|
135
135
|
show: true,
|
136
|
-
disabled: @examples.
|
136
|
+
disabled: @examples.select { |e| e[:notes].present? }.none?
|
137
137
|
},
|
138
138
|
params: {
|
139
139
|
label: "Params",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% items = examples.
|
1
|
+
<% items = examples.select { |example| example[:notes].present? } %>
|
2
2
|
<div class="text-gray-600 bg-gray-50 h-full overflow-auto" data-morph-strategy="replace">
|
3
3
|
<% if items.many? %>
|
4
4
|
<div class="divide-y divide-dashed divide-gray-300">
|
@@ -22,4 +22,4 @@
|
|
22
22
|
<% end %>
|
23
23
|
</div>
|
24
24
|
<% end %>
|
25
|
-
</div>
|
25
|
+
</div>
|
data/lib/lookbook/engine.rb
CHANGED
@@ -53,7 +53,7 @@ module Lookbook
|
|
53
53
|
options.listen_paths = options.listen_paths.map(&:to_s)
|
54
54
|
options.listen_paths += options.preview_paths
|
55
55
|
options.listen_paths << (vc_options.view_component_path || Rails.root.join("app/components"))
|
56
|
-
options.listen_paths.
|
56
|
+
options.listen_paths.select! { |path| Dir.exist? path }
|
57
57
|
|
58
58
|
options.cable_mount_path ||= "/lookbook-cable"
|
59
59
|
options.cable_logger ||= Rails.logger
|
@@ -95,7 +95,7 @@ module Lookbook
|
|
95
95
|
@preview_listener.start
|
96
96
|
|
97
97
|
if Lookbook::Features.enabled?(:pages)
|
98
|
-
@page_listener = Listen.to(*config.lookbook.page_paths.
|
98
|
+
@page_listener = Listen.to(*config.lookbook.page_paths.select { |dir| Dir.exist? dir }, only: /\.(html.*|md.*)$/) do |modified, added, removed|
|
99
99
|
Lookbook::Engine.websocket&.broadcast("reload", {
|
100
100
|
modified: modified,
|
101
101
|
removed: removed,
|
data/lib/lookbook/page.rb
CHANGED
@@ -19,7 +19,7 @@ module Lookbook
|
|
19
19
|
|
20
20
|
def initialize(path, base_path)
|
21
21
|
@pathname = Pathname.new path
|
22
|
-
@base_path = base_path
|
22
|
+
@base_path = Pathname.new base_path
|
23
23
|
@options = nil
|
24
24
|
@errors = []
|
25
25
|
end
|
@@ -153,7 +153,7 @@ module Lookbook
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def page_paths
|
156
|
-
Lookbook.config.page_paths.
|
156
|
+
Lookbook.config.page_paths.select { |dir| Dir.exist? dir }
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
data/lib/lookbook/preview.rb
CHANGED
@@ -33,7 +33,7 @@ module Lookbook
|
|
33
33
|
def examples
|
34
34
|
return @examples if @examples.present?
|
35
35
|
public_methods = @preview.public_instance_methods(false)
|
36
|
-
public_method_objects = @preview_inspector&.methods&.
|
36
|
+
public_method_objects = @preview_inspector&.methods&.select { |m| public_methods.include?(m.name) }
|
37
37
|
examples = (public_method_objects || []).map { |m| PreviewExample.new(m.name.to_s, self) }
|
38
38
|
sorted = Lookbook.config.sort_examples ? examples.sort_by(&:label) : examples
|
39
39
|
@examples = []
|
data/lib/lookbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lookbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actioncable
|
@@ -321,7 +321,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
321
321
|
requirements:
|
322
322
|
- - ">="
|
323
323
|
- !ruby/object:Gem::Version
|
324
|
-
version:
|
324
|
+
version: 2.5.0
|
325
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
326
326
|
requirements:
|
327
327
|
- - ">="
|