lookbook 0.7.2 → 0.7.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: 6df32e43d6fbb0a7b88e0db9bbb4bd9562f3528f3a7160463d078daf262954f3
4
- data.tar.gz: cfbd08c5a4d06a56ef8bd9016139e3d04a4195e2590d5be741e1c238ce390744
3
+ metadata.gz: 40ea30d04c53c14779624094908938ce4c795a75a773f24226c7905e12afcdca
4
+ data.tar.gz: 15b596f54edd9cff72d28cf2c3b88a5d28e05b3a323f69033bd44c50c890c3c2
5
5
  SHA512:
6
- metadata.gz: bd42877713e33dc0ad3d1bf4fddc1ab561171d01417f6b415ceda15abeeba45996c9e0478afb02117363a1686b063daf1e283ff0f84c6d0b591c59c50e0ba744
7
- data.tar.gz: e12acc1799810736e3f5bad6e3d096f7c1f68ddb0de5b0d1aa0324f1b7b0bd707d733750c5ed8a56cb3ab87d921036cd7b340927971186f98bbf5a402d41acf0
6
+ metadata.gz: 2c998b17b156fae344b99131d7487ba74052d1aeaba6ac9ff2cd2c13371f6aa0f3fb1cea6d47b806d4cd3479d93e678fd165b8f85bc30b2c7e35bac1b2685ea5
7
+ data.tar.gz: f347430b5596aaefc63c24a1db82758a86f317cc728bd7c8cb1eefe9efd243e3072186b33fc0144fd7f0fea148d584d3b350b2da09b59ba37be37e41b706f4b2
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"
2
+ VERSION = "0.7.3"
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
4
+ version: 0.7.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-04-05 00:00:00.000000000 Z
11
+ date: 2022-04-07 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
@@ -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