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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ab45880b0ec4a3dabedeec7ba8480d7201035a06ba11b90f7a7bd103ecd725f
4
- data.tar.gz: 27d24ba2beea3a03d344584313a1735668607afc5a04c5ee69d95786afc35921
3
+ metadata.gz: 453e5dfb0d3e538aee997796260580b39243927ab8766bb6186cba9aecf7aca7
4
+ data.tar.gz: 94df332804838cbf2e269d31ab0c46bcb5a9e123df37132d08e8b2e7413c8a84
5
5
  SHA512:
6
- metadata.gz: 783df445e617e2896b9180f49a36af08c8adfee6b59224b9ef3fe18326cd6bc0033688ad3bce1aa06f1d492dc2b111de0a59f7c2d56126cf3ca70aad94cad34c
7
- data.tar.gz: 15ec12b7fc4d432d84b4c6202ee021b2a29c7c60fa85a412ba763a012a7362601a960fb9c5ca30fbf08343cd06072d07f5e9019c9fa124a5f798b74f867beefd
6
+ metadata.gz: c2ee47380f0a99f2ef0679805c3d2ae7319ac1286721cfb680245fa6b3176c952147a09bab197881b6ab2ad299bd693afe8923a7add29daf732f437274e8ce03
7
+ data.tar.gz: c9f3eb5095c6238cc5217cd5b2f393f9293af9ed940aec550aa7628e2cb10fff6a713efbee5e869e2ec305d39f8266737b75dff915a70d3eada330d09baf0a02
@@ -17,6 +17,8 @@ module Docwatch
17
17
  when '/wait'
18
18
  @watcher.wait
19
19
  @session.respond_with_text 'OK'
20
+ else
21
+ @session.respond_with_404
20
22
  end
21
23
  end
22
24
  end
@@ -12,22 +12,28 @@ module Docwatch
12
12
  end
13
13
 
14
14
  def path
15
- return if first_request_line.length == 0
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 200'
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 rescue []
46
+ @input_lines ||= @socket.recvmsg[0].lines
47
+ rescue
48
+ []
41
49
  end
42
50
 
43
51
  def first_request_line
@@ -1,3 +1,3 @@
1
1
  module Docwatch
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
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.2
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-02-06 00:00:00.000000000 Z
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.7
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