plezi 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/plezi/base/engine.rb +7 -0
- data/lib/plezi/handlers/controller_magic.rb +1 -1
- data/lib/plezi/handlers/stubs.rb +1 -1
- data/lib/plezi/server/protocols/http_request.rb +5 -0
- data/lib/plezi/server/protocols/http_response.rb +3 -3
- data/lib/plezi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 549ca7646d6226a6beb69854ecd8076fba8fbd62
|
4
|
+
data.tar.gz: 52fa9fe134cbcbb7bdd018e1c0d36d9cd0bcc7f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5833877cd84d581d347d97ee28bc7fb8b82c8f702d11f5f0989a2aa12c2a21507103c147af928ad929020683d3e6219661a09267a413e36ce3b9e9b8976f328f
|
7
|
+
data.tar.gz: d322ad5cfd6de248e5f018b0de2fa98289b8f0753aaa10b2cee9599c95fd30b0edbeebb235c7d573f3c03eed7766cb2cb4d455c78a0dfc8101c64dbbca16cf0b
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,14 @@
|
|
3
3
|
***
|
4
4
|
|
5
5
|
Change log v.0.7.7
|
6
|
-
|
6
|
+
|
7
|
+
**fix**: fixed a header issue in the HTTPResponse that prevented websocket connections.
|
8
|
+
|
9
|
+
**deprecation notice**:
|
10
|
+
|
11
|
+
v.0.8.0 will consist of many changes that will also influence the API. The 0.8.0 version will mark the begining of some major rewrites, so that the code will be even easier to maintain.
|
12
|
+
|
13
|
+
If your code depends on Timers and other advanced API, please review your code before updating to the 0.8.0 version.
|
7
14
|
|
8
15
|
***
|
9
16
|
|
data/lib/plezi/base/engine.rb
CHANGED
@@ -30,6 +30,13 @@ module Plezi
|
|
30
30
|
trap('INT'){ exit_flag = true; raise "close Plezi" }
|
31
31
|
trap('TERM'){ exit_flag = true; raise "close Plezi" }
|
32
32
|
puts "Services running Plezi version #{Plezi::VERSION}. Press ^C to stop"
|
33
|
+
puts %q{**deprecation notice**:
|
34
|
+
|
35
|
+
v.0.8.0 will consist of many changes that will also influence the API. The 0.8.0 version will mark the begining of some major rewrites, so that the code will be even easier to maintain.
|
36
|
+
|
37
|
+
If your code depends on Timers and other advanced API, please review your code before updating to the 0.8.0 version.
|
38
|
+
|
39
|
+
}
|
33
40
|
# sleep until trap raises exception (cycling might cause the main thread to ignor signals and lose attention)
|
34
41
|
(sleep unless SERVICES.empty?) rescue true
|
35
42
|
# start shutdown.
|
@@ -35,7 +35,7 @@ module Plezi
|
|
35
35
|
attr_reader :cookies
|
36
36
|
|
37
37
|
# the HTTPResponse **OR** the WSResponse object that formats the response and sends it. use `response << data`. This object can be used to send partial data (such as headers, or partial html content) in blocking mode as well as sending data in the default non-blocking mode.
|
38
|
-
|
38
|
+
attr_reader :response
|
39
39
|
|
40
40
|
# the ::flash is a little bit of a magic hash that sets and reads temporary cookies.
|
41
41
|
# these cookies will live for one successful request to a Controller and will then be removed.
|
data/lib/plezi/handlers/stubs.rb
CHANGED
@@ -36,7 +36,7 @@ module Plezi
|
|
36
36
|
"Should we make something new?"
|
37
37
|
end
|
38
38
|
|
39
|
-
# called when request is POST or PUT and params\[:id] isn't defined params\[:id] == "new"
|
39
|
+
# called when request is POST or PUT and params\[:id] isn't defined or params\[:id] == "new"
|
40
40
|
def save
|
41
41
|
"save called - creating a new object."
|
42
42
|
end
|
@@ -59,6 +59,11 @@ module Plezi
|
|
59
59
|
"#{switch_protocol || self[:requested_protocol]}://#{self[:host_name]}#{self[:port]? ":#{self[:port]}" : ''}"
|
60
60
|
end
|
61
61
|
|
62
|
+
# the request's url, without any GET parameters ([http/https]://host[:port]/path)
|
63
|
+
def request_url switch_protocol = nil
|
64
|
+
"#{base_url switch_protocol}#{self[:original_path]}"
|
65
|
+
end
|
66
|
+
|
62
67
|
# the service (socket wrapper) that answered this request
|
63
68
|
def service
|
64
69
|
self[:plezi_service]
|
@@ -191,10 +191,10 @@ module Plezi
|
|
191
191
|
|
192
192
|
# Danger Zone (internally used method, use with care): fix response's headers before sending them (date, connection and transfer-coding).
|
193
193
|
def fix_headers
|
194
|
-
headers['
|
195
|
-
headers['
|
194
|
+
headers['keep-alive'] ||= "timeout=5" unless headers['connection']
|
195
|
+
headers['connection'] ||= "Keep-Alive"
|
196
196
|
headers['date'] = Time.now.httpdate
|
197
|
-
headers['transfer-encoding'] ||= 'chunked'
|
197
|
+
headers['transfer-encoding'] ||= 'chunked' unless headers['content-length']
|
198
198
|
headers['cache-control'] ||= 'no-cache'
|
199
199
|
# remove old flash cookies
|
200
200
|
request.cookies.keys.each do |k|
|
data/lib/plezi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plezi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|