nut 0.1.6 → 0.1.7
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/nut/handler.rb +8 -8
- data/lib/nut/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: 78b0510dacf5c5eb7282d4ebf6201376588a6f45
|
4
|
+
data.tar.gz: 7e7d0affcd44869b64813da5686a0faf63cd506b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72f5f2bd8c7d816ad30282e4a7f292017503ea051fddb2106022d52d0d58cdd3d7cc2eb061572b8dae9d09a92e34e74dc70af0d05699d27d6e98baef569b8bc
|
7
|
+
data.tar.gz: 4779a82ab14e4cb5d5c18cc67b3523e516019d1f3231b4cb1958bd7cf2ec2629f288ea0b8d12159e765761b005bec4c15d8efeaee3e36eba358fee0e27f0b3e4
|
data/lib/nut/handler.rb
CHANGED
@@ -28,14 +28,14 @@ module Nut
|
|
28
28
|
SUPPORTED_VERSION = 'http/1.1'
|
29
29
|
|
30
30
|
# On Join
|
31
|
-
#
|
31
|
+
# RxIO Service Interface Callback - Triggered each time a Client connects.
|
32
32
|
# @param [Hash] client An RxIO Client Hash
|
33
33
|
def self.on_join client
|
34
34
|
# NoOp
|
35
35
|
end
|
36
36
|
|
37
37
|
# On Drop
|
38
|
-
#
|
38
|
+
# RxIO Service Interface Callback - Triggered each time a Client disconnects.
|
39
39
|
# @param [Hash] client An RxIO Client Hash
|
40
40
|
def self.on_drop client
|
41
41
|
# NoOp
|
@@ -52,7 +52,7 @@ module Nut
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Sub-Process Input
|
55
|
-
#
|
55
|
+
# RxIO Service Interface Callback - Triggered each time a chunk of data is received from a Client.
|
56
56
|
# Some Content-Length-based Requests may not end with a CRLF - this pulls in any left-over data directly from the RxIO Input Buffer.
|
57
57
|
# @param [Hash] client Client Hash
|
58
58
|
def self.subprocess_input client
|
@@ -65,7 +65,7 @@ module Nut
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Handle Request Data Line
|
68
|
-
#
|
68
|
+
# Ensures availability of a Client Request Context before passing Assembling & Processing.
|
69
69
|
# @param [Hash] client An RxIO Client Hash
|
70
70
|
# @param [String] msg The message received from the Client (including newline)
|
71
71
|
def self.handle_req_dline client, msg
|
@@ -78,7 +78,7 @@ module Nut
|
|
78
78
|
end
|
79
79
|
|
80
80
|
# Ensure Client Request Hash
|
81
|
-
#
|
81
|
+
# Ensures existence of Client Request Hash inside Client Context.
|
82
82
|
# @param [Hash] client An RxIO Client Hash
|
83
83
|
def self.ensure_creq client
|
84
84
|
|
@@ -107,7 +107,7 @@ module Nut
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# Assemble & Process Request
|
110
|
-
#
|
110
|
+
# Assembles and processes HTTP Requests from individual data lines.
|
111
111
|
# @param [Hash] creq Client Request Context
|
112
112
|
# @param [String] msg The message received from the Client (including newline)
|
113
113
|
def self.assemble_process_req creq, msg
|
@@ -132,7 +132,7 @@ module Nut
|
|
132
132
|
end
|
133
133
|
|
134
134
|
# Process Request for Client
|
135
|
-
#
|
135
|
+
# Constructs a complete Request Hash from a Client Request Context and passes it to the Request Handler Module's _handle_req_ method.
|
136
136
|
# @param [Hash] client An RxIO Client Hash
|
137
137
|
def self.process_req client
|
138
138
|
|
@@ -166,7 +166,7 @@ module Nut
|
|
166
166
|
end
|
167
167
|
|
168
168
|
# Serve Response
|
169
|
-
#
|
169
|
+
# Sends out an HTTP Response to the Client.
|
170
170
|
# @param [Hash] response Response Hash
|
171
171
|
def self.serve_response client, response
|
172
172
|
|
data/lib/nut/version.rb
CHANGED