octodown 1.8.3 → 1.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octodown/renderer/server.rb +10 -3
- data/lib/octodown/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d69e3ea20bb771e3543300392cfcd93740a51f7
|
4
|
+
data.tar.gz: 30f21c0d5a4db0472a940e4b9ea978b6cf4c3143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0cbaafd0246b4936627001f3d3611f9fecae63d6cf7570e4ba5d9026d8109dacf7163badcc320b067bedfd1cb64fa3e60339deda1d0084d352e7acedfce66e9
|
7
|
+
data.tar.gz: 39faf85924e565cc85a1eb7b65b7af0259ecb515a20616ba10f9f10288d8cf7d27f6442c2896d8adb46e1f1d38a8be77651b06840a39b4ced8dd84a04bdfdc35
|
@@ -8,6 +8,8 @@ require 'launchy'
|
|
8
8
|
module Octodown
|
9
9
|
module Renderer
|
10
10
|
class Server
|
11
|
+
Thread.abort_on_exception = true
|
12
|
+
|
11
13
|
attr_reader :file, :path, :options, :port, :logger
|
12
14
|
|
13
15
|
def initialize(_content, options = {})
|
@@ -24,7 +26,6 @@ module Octodown
|
|
24
26
|
register_listener
|
25
27
|
|
26
28
|
Thread.new do
|
27
|
-
Thread.abort_on_exception = true
|
28
29
|
maybe_launch_browser
|
29
30
|
end
|
30
31
|
|
@@ -34,7 +35,11 @@ module Octodown
|
|
34
35
|
def boot_server
|
35
36
|
logger.info "#{file.path} is getting octodown'd"
|
36
37
|
logger.info "Server running on http://localhost:#{port}"
|
37
|
-
Rack::Handler::Puma.run app,
|
38
|
+
Rack::Handler::Puma.run app,
|
39
|
+
Host: 'localhost',
|
40
|
+
Port: port,
|
41
|
+
Silent: true,
|
42
|
+
Threads: '2:8'
|
38
43
|
end
|
39
44
|
|
40
45
|
def maybe_launch_browser
|
@@ -105,7 +110,9 @@ module Octodown
|
|
105
110
|
logger.info "Changes to #{file.path} detected, updating"
|
106
111
|
md = render_md(file)
|
107
112
|
@websockets.each do |socket|
|
108
|
-
|
113
|
+
Thread.new do
|
114
|
+
socket.send md
|
115
|
+
end
|
109
116
|
end
|
110
117
|
end
|
111
118
|
end
|
data/lib/octodown/version.rb
CHANGED