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: 0b2895b167e1e2dc38f33927d4dfab553e0fe58e11b3558330d95eb139011c25
4
- data.tar.gz: c7c62607dc8634d4883fde5a4495d5bfcf7c2fb30edbb37ba4ab228bf0735cd2
3
+ metadata.gz: da304532fa0dd06355ed74fa190827c04ed8f1dd07953e0db2e12469a61555dc
4
+ data.tar.gz: ab65b3585a8eed51792f6fc1ec561a85f2f2a1b7884a949e65b4dddb2d6f8fa5
5
5
  SHA512:
6
- metadata.gz: 510e98f6284e5d374347612e4c724bb5745b09cf82945443d2f37c6a54dde996298c31598ba2a5188ee325fb7ee550857bf66b1f9ecf260fb0ea4db0963f50b1
7
- data.tar.gz: 2d41d201fd170a206b91638cc6eb51d638ade8f8d8c30206ce5e4ecbb0e53023c68379fc93428b161e4b5efeb28ead5b4d6908d9e689b493b58175f0016ab4a9
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.filter { |name, panel| panel[:show] }
32
- @preview_panels = preview_panels.filter { |name, panel| panel[:show] }
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.filter { |e| e[:notes].present? }.none?
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.filter { |example| example[:notes].present? } %>
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>
@@ -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.filter! { |path| Dir.exist? path }
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.filter { |dir| Dir.exist? dir }, only: /\.(html.*|md.*)$/) do |modified, added, removed|
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.filter { |dir| Dir.exist? dir }
156
+ Lookbook.config.page_paths.select { |dir| Dir.exist? dir }
157
157
  end
158
158
  end
159
159
  end
@@ -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&.filter { |m| public_methods.include?(m.name) }
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 = []
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
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.2
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-02 00:00:00.000000000 Z
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: '0'
324
+ version: 2.5.0
325
325
  required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  requirements:
327
327
  - - ">="