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 +4 -4
- data/config/routes.rb +1 -1
- data/lib/lookbook/engine.rb +12 -16
- data/lib/lookbook/version.rb +1 -1
- data/lib/lookbook.rb +0 -1
- metadata +2 -3
- data/lib/lookbook/null_logger.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40ea30d04c53c14779624094908938ce4c795a75a773f24226c7905e12afcdca
|
4
|
+
data.tar.gz: 15b596f54edd9cff72d28cf2c3b88a5d28e05b3a323f69033bd44c50c890c3c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c998b17b156fae344b99131d7487ba74052d1aeaba6ac9ff2cd2c13371f6aa0f3fb1cea6d47b806d4cd3479d93e678fd165b8f85bc30b2c7e35bac1b2685ea5
|
7
|
+
data.tar.gz: f347430b5596aaefc63c24a1db82758a86f317cc728bd7c8cb1eefe9efd243e3072186b33fc0144fd7f0fea148d584d3b350b2da09b59ba37be37e41b706f4b2
|
data/config/routes.rb
CHANGED
data/lib/lookbook/engine.rb
CHANGED
@@ -10,7 +10,7 @@ module Lookbook
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def logger
|
13
|
-
@logger ||=
|
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.
|
58
|
-
options.
|
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:
|
118
|
+
ActionCable::Server::Base.new(config: cable)
|
123
119
|
else
|
124
120
|
websocket ||= ActionCable::Server::Base.new
|
125
|
-
websocket.config =
|
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.
|
128
|
+
"#{mounted_path}#{config.lookbook.cable_mount_path}" if websocket
|
133
129
|
end
|
134
130
|
|
135
131
|
def mounted_path
|
data/lib/lookbook/version.rb
CHANGED
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.
|
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-
|
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
|
data/lib/lookbook/null_logger.rb
DELETED
@@ -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
|