nut 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/nut/handler.rb +1 -1
- 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: c13a9a968fdcf0e75dd2b69e134b06bd4770fcf7
|
4
|
+
data.tar.gz: be12340e175e32f0c1fbe52407cb5585e5919964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86a162c0df012f1e4814f05cc52faab89230e508339c88f49143b6c403f1b2d3336ee568f259c6b7f5e1b5f612542c2a33eba9e13a7e7b2faeac98776c6a2161
|
7
|
+
data.tar.gz: 108dcbeaed5946f4efedb8e5bdd0d2e500b41e0feb5755c737465a32d223b128bdcff93a2240ce9f819d21733caaf122d982d39a5005e2414915a052a1996b58
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ n = Nut::Service.new ExampleRequestHandler
|
|
47
47
|
The _request_ argument to the *handle* method is a Hash containing information representing a client request.
|
48
48
|
|
49
49
|
The following fields are available:
|
50
|
-
* *:peer* - RxIO Peer Information Hash such as { name: '
|
50
|
+
* *:peer* - RxIO Peer Information Hash such as { name: 'client1.example.com', addr: '51.254.97.136', port: 42432 }
|
51
51
|
* *:verb* - HTTP Verb such as :get / :post
|
52
52
|
* *:uri* - Request URI (without host and params)
|
53
53
|
* *:body* - Complete Request Body (without headers)
|
@@ -134,8 +134,8 @@ If *response[:redirect]* is a String, Nut will respond with a *302 Found* "tempo
|
|
134
134
|
module ExampleRequestHandler
|
135
135
|
def handle request, response
|
136
136
|
|
137
|
-
# Temporarily Redirect to 'http://
|
138
|
-
response[:redirect] = 'http://
|
137
|
+
# Temporarily Redirect to 'http://www.example.com'
|
138
|
+
response[:redirect] = 'http://www.example.com'
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
@@ -150,8 +150,8 @@ If *response[:redirect]* is a Hash, Nut will respond with either a *302 Found* o
|
|
150
150
|
module ExampleRequestHandler
|
151
151
|
def handle request, response
|
152
152
|
|
153
|
-
# Permanently Redirect to 'http://eresse.net'
|
154
|
-
response[:redirect] = { to: 'http://eresse.net', permanent: true }
|
153
|
+
# Permanently Redirect to 'http://www.eresse.net'
|
154
|
+
response[:redirect] = { to: 'http://www.eresse.net', permanent: true }
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
data/lib/nut/handler.rb
CHANGED
@@ -28,7 +28,7 @@ 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
|
data/lib/nut/version.rb
CHANGED