lookbook 0.7.2.beta.5 → 0.7.4

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: e5c4fab31fdd907dfcc4e990f703be32ce602db1729187d88c88abf60cc126bc
4
- data.tar.gz: 57373e4f626acbbe451532587758f8962ba9186314d31752001f3b05baef5338
3
+ metadata.gz: 96f31c2b265d871a152627dfb10b0c0e1f6db8ae42e811abfeb138c7bf45d806
4
+ data.tar.gz: 9ae695f9a3fc7c28bd5a7fbf77fc0959d92d46661525e7593961555cd41d76fb
5
5
  SHA512:
6
- metadata.gz: 4fc584e15f47fb60256e7fa49111df0a97fe7ac1a588c8e84657957e321cd1e9f627700a5969fd7efa03bf26a923005dc742ab277f2e993416fc1c83a2a5af89
7
- data.tar.gz: 69a701e03da79385d9302e61c9df58b364eaf3e2f2160e8660c762810d9851a943297b061ad962af6fb0b056754e3b8af191c32a64f098a1487c1599bc668965
6
+ metadata.gz: 8b658dc2f0e2b7213761be9197f916594381319927f02097c3901af13d9c35194e45d568d70a21c3da05407ea79e589ffa1c3530905c73dc5cbfa1100cc2ac3f
7
+ data.tar.gz: 55bc108c5a1ee957970709efe01c75956ee7b925043bab7b5c6aba1bafa1f998191d7872a7e08ddbd85daad2d7713437ec9340c8f2273568ecffa17bbb78a738
@@ -1,4 +1,4 @@
1
- <div class="bg-gray-50 h-full">
1
+ <div class="bg-gray-50 h-full overflow-auto">
2
2
  <% if @example.type == :group %>
3
3
  <div class="p-4 prose prose-sm">
4
4
  <em class='opacity-50'>Params are not yet supported for grouped examples.</em>
data/config/routes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  Lookbook::Engine.routes.draw do
2
2
  if Lookbook.config.auto_refresh
3
- mount Lookbook::Engine.websocket => Lookbook.config.cable.mount_path
3
+ mount Lookbook::Engine.websocket => Lookbook.config.cable_mount_path
4
4
  end
5
5
 
6
6
  root to: "application#index", as: :home
@@ -10,7 +10,7 @@ module Lookbook
10
10
  end
11
11
 
12
12
  def logger
13
- @logger ||= config.debug == true ? Rails.logger : Lookbook::NullLogger.new
13
+ @logger ||= Rails.logger
14
14
  end
15
15
 
16
16
  def version
@@ -54,10 +54,8 @@ module Lookbook
54
54
  options.listen_paths << (vc_options.view_component_path || Rails.root.join("app/components"))
55
55
  options.listen_paths.filter! { |path| Dir.exist? path }
56
56
 
57
- options.cable = ActionCable::Server::Configuration.new
58
- options.cable.cable = {adapter: "async"}.with_indifferent_access
59
- options.cable.mount_path ||= "/lookbook-cable"
60
- options.cable.connection_class = -> { Lookbook::Connection }
57
+ options.cable_mount_path ||= "/lookbook-cable"
58
+ options.cable_logger ||= Rails.logger
61
59
 
62
60
  options.experimental_features = false unless options.experimental_features.present?
63
61
  end
@@ -73,14 +71,6 @@ module Lookbook
73
71
  )
74
72
  end
75
73
 
76
- initializer "lookbook.logging" do
77
- if config.lookbook.debug == true
78
- config.lookbook.cable.logger ||= Rails.logger
79
- else
80
- config.lookbook.cable.logger = Lookbook::NullLogger.new
81
- end
82
- end
83
-
84
74
  config.after_initialize do
85
75
  @preview_listener = Listen.to(*config.lookbook.listen_paths, only: /\.(rb|html.*)$/) do |modified, added, removed|
86
76
  begin
@@ -118,18 +108,24 @@ module Lookbook
118
108
  class << self
119
109
  def websocket
120
110
  if config.lookbook.auto_refresh
111
+ cable = ActionCable::Server::Configuration.new
112
+ cable.cable = {adapter: "async"}.with_indifferent_access
113
+ cable.mount_path = config.lookbook.cable_mount_path
114
+ cable.connection_class = -> { Lookbook::Connection }
115
+ cable.logger = config.lookbook.cable_logger
116
+
121
117
  @websocket ||= if Rails.version.to_f >= 6.0
122
- ActionCable::Server::Base.new(config: config.lookbook.cable)
118
+ ActionCable::Server::Base.new(config: cable)
123
119
  else
124
120
  websocket ||= ActionCable::Server::Base.new
125
- websocket.config = config.lookbook.cable
121
+ websocket.config = cable
126
122
  websocket
127
123
  end
128
124
  end
129
125
  end
130
126
 
131
127
  def websocket_mount_path
132
- "#{mounted_path}#{config.lookbook.cable.mount_path}" if websocket
128
+ "#{mounted_path}#{config.lookbook.cable_mount_path}" if websocket
133
129
  end
134
130
 
135
131
  def mounted_path
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "0.7.2.beta.5"
2
+ VERSION = "0.7.4"
3
3
  end
data/lib/lookbook.rb CHANGED
@@ -20,7 +20,6 @@ module Lookbook
20
20
  autoload :PreviewExample, "lookbook/preview_example"
21
21
  autoload :PreviewGroup, "lookbook/preview_group"
22
22
  autoload :CodeInspector, "lookbook/code_inspector"
23
- autoload :NullLogger, "lookbook/null_logger"
24
23
  autoload :CodeFormatter, "lookbook/code_formatter"
25
24
  autoload :Markdown, "lookbook/markdown"
26
25
 
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.7.2.beta.5
4
+ version: 0.7.4
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-04-04 00:00:00.000000000 Z
11
+ date: 2022-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable
@@ -290,7 +290,6 @@ files:
290
290
  - lib/lookbook/features.rb
291
291
  - lib/lookbook/lang.rb
292
292
  - lib/lookbook/markdown.rb
293
- - lib/lookbook/null_logger.rb
294
293
  - lib/lookbook/page.rb
295
294
  - lib/lookbook/page_collection.rb
296
295
  - lib/lookbook/params.rb
@@ -325,9 +324,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
325
324
  version: '0'
326
325
  required_rubygems_version: !ruby/object:Gem::Requirement
327
326
  requirements:
328
- - - ">"
327
+ - - ">="
329
328
  - !ruby/object:Gem::Version
330
- version: 1.3.1
329
+ version: '0'
331
330
  requirements: []
332
331
  rubygems_version: 3.2.22
333
332
  signing_key:
@@ -1,47 +0,0 @@
1
- module Lookbook
2
- class NullLogger
3
- def unknown(*)
4
- nil
5
- end
6
-
7
- def fatal(*)
8
- nil
9
- end
10
-
11
- def fatal?
12
- false
13
- end
14
-
15
- def error(*)
16
- nil
17
- end
18
-
19
- def error?
20
- false
21
- end
22
-
23
- def warn(*)
24
- nil
25
- end
26
-
27
- def warn?
28
- false
29
- end
30
-
31
- def info(*)
32
- nil
33
- end
34
-
35
- def info?
36
- false
37
- end
38
-
39
- def debug(*)
40
- nil
41
- end
42
-
43
- def debug?
44
- false
45
- end
46
- end
47
- end