docwatch-bin 1.1.2 → 1.1.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/lib/docwatch/connection.rb +2 -0
- data/lib/docwatch/session.rb +15 -7
- data/lib/docwatch/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 453e5dfb0d3e538aee997796260580b39243927ab8766bb6186cba9aecf7aca7
|
4
|
+
data.tar.gz: 94df332804838cbf2e269d31ab0c46bcb5a9e123df37132d08e8b2e7413c8a84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2ee47380f0a99f2ef0679805c3d2ae7319ac1286721cfb680245fa6b3176c952147a09bab197881b6ab2ad299bd693afe8923a7add29daf732f437274e8ce03
|
7
|
+
data.tar.gz: c9f3eb5095c6238cc5217cd5b2f393f9293af9ed940aec550aa7628e2cb10fff6a713efbee5e869e2ec305d39f8266737b75dff915a70d3eada330d09baf0a02
|
data/lib/docwatch/connection.rb
CHANGED
data/lib/docwatch/session.rb
CHANGED
@@ -12,22 +12,28 @@ module Docwatch
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def path
|
15
|
-
|
15
|
+
if first_request_line.nil? || first_request_line.length == 0
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
16
19
|
first_request_line.split(' ')[1]
|
17
20
|
end
|
18
21
|
|
19
22
|
def respond_with_text(str)
|
20
|
-
respond_with(str, 'text/plain')
|
23
|
+
respond_with(200, str, 'text/plain')
|
21
24
|
end
|
22
25
|
|
23
26
|
def respond_with_html(str)
|
24
|
-
respond_with(str, 'text/html')
|
27
|
+
respond_with(200, str, 'text/html')
|
28
|
+
end
|
29
|
+
|
30
|
+
def respond_with_404
|
31
|
+
respond_with(404, 'Not Found', 'text/html')
|
25
32
|
end
|
26
33
|
|
27
|
-
def respond_with(str, content_type)
|
28
|
-
println 'HTTP/1.1
|
34
|
+
def respond_with(code, str, content_type)
|
35
|
+
println 'HTTP/1.1 %d' % code
|
29
36
|
println 'Content-Type: %s; charset=utf8' % content_type
|
30
|
-
# println 'Connection: close'
|
31
37
|
println
|
32
38
|
println str
|
33
39
|
|
@@ -37,7 +43,9 @@ module Docwatch
|
|
37
43
|
private
|
38
44
|
|
39
45
|
def input_lines
|
40
|
-
@input_lines ||= @socket.recvmsg[0].lines
|
46
|
+
@input_lines ||= @socket.recvmsg[0].lines
|
47
|
+
rescue
|
48
|
+
[]
|
41
49
|
end
|
42
50
|
|
43
51
|
def first_request_line
|
data/lib/docwatch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docwatch-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crdx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.2.
|
163
|
+
rubygems_version: 3.2.21
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Preview markdown documents in the browser with reload on change
|