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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba4ae19c5a61ca23f12826d1e3eabcde4ca8ba21
4
- data.tar.gz: 9fa3579011986dc14efbe679a16f867d54e92a2c
3
+ metadata.gz: 549ca7646d6226a6beb69854ecd8076fba8fbd62
4
+ data.tar.gz: 52fa9fe134cbcbb7bdd018e1c0d36d9cd0bcc7f9
5
5
  SHA512:
6
- metadata.gz: 967cacbbf63c8fcaa6a136051d5894f8cc93a49f38d3d21495dd3cc2ab38bb21121f73dc37de46f96c4d51b5a2203b7c351d7eb6ece02405959b7224687b9cab
7
- data.tar.gz: a66e08cb87f9742d756a3c59122f1422474a6a455c1e83bf49f9156cb51bad7d77c8a21a298a762fbe6ac8a7c4dc4983109c4937b11e4632ea66af4f22620277
6
+ metadata.gz: 5833877cd84d581d347d97ee28bc7fb8b82c8f702d11f5f0989a2aa12c2a21507103c147af928ad929020683d3e6219661a09267a413e36ce3b9e9b8976f328f
7
+ data.tar.gz: d322ad5cfd6de248e5f018b0de2fa98289b8f0753aaa10b2cee9599c95fd30b0edbeebb235c7d573f3c03eed7766cb2cb4d455c78a0dfc8101c64dbbca16cf0b
@@ -3,7 +3,14 @@
3
3
  ***
4
4
 
5
5
  Change log v.0.7.7
6
- (pre-release)
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
 
@@ -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
- attr_accessor :response
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.
@@ -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['connection'] = "Keep-Alive"
195
- headers['keep-alive'] = "timeout=5"
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' if !headers['content-length']
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|
@@ -1,3 +1,3 @@
1
1
  module Plezi
2
- VERSION = "0.7.6"
2
+ VERSION = "0.7.7"
3
3
  end
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.6
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-04 00:00:00.000000000 Z
11
+ date: 2015-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler