plezi 0.12.21 → 0.12.22

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: 393d101919837f0ce957673f30cf4afa858977bb
4
- data.tar.gz: 5e23ca2e9ddd479fefd37c0747c246a924f6c755
3
+ metadata.gz: 8eab38fb8e80a3c148bfcc217f44e3ade73f9adc
4
+ data.tar.gz: 5bcdd05f5c30e0cf177b983d757f21e6c13b7bf8
5
5
  SHA512:
6
- metadata.gz: 855bc07cedb86d69f9787f6740a8f3397140487d9f00d5eb7fbfbafbc7bf912e8a9719b44ed0d683ea1370a115984f83c6097abda71b3fc6a10a83d68226498d
7
- data.tar.gz: 1ca4b13dd3ca651514b5822c1265bff122d1b0d791cab76a841926139b8b93c655b2107611781408399c9b224ce0fdc892f392da1bb0db2f1f96a44a5de40963
6
+ metadata.gz: 60bfb7361f4f50d380f6db994795959ddb611e421e42a1f09ea4a9cd1dcc36c7eac1a5c5edd094ae5bffe52f4176f8ca2cb46af134f718b18ceb6e1725bb5ce4
7
+ data.tar.gz: d8ecf48b40a0feacec0cc0b86dae87a00cd19f0523e58a829d0d9d1f19eaf9d82816fea4d4e7f2ae85d407786075f032ccf8c267162f9d8b11465f755f1debc1
@@ -1,5 +1,24 @@
1
1
  #Change Log
2
2
 
3
+ ***
4
+
5
+ Change log v.0.12.22
6
+
7
+ **Fix**: fix for issue #17 where unicode characters might cause `erb` rendering to fail. Credit to @davidjuin0519 (Juin Chiu) for reporting the issue and helping resolve it.
8
+
9
+ * **Deprecation notice**:
10
+
11
+ v.0.12.22 will probably be the last one for a pure Ruby implementation. Future versions might be limited to Ruby MRI due to C extensions being used.
12
+
13
+ Plezi's server, Iodine, was re-written in C, allowing for a smaller memory footprint, more speed and tens of thousands of concurrent connections (using `kqueue` and `epoll`, instead of Ruby's `select` which is limited to 1024 connections).
14
+
15
+ Plezi 0.13.x will be using Iodine's C version (0.2.x) by default.
16
+
17
+ Since Iodine 0.2.x is Rack complient, Plezi will be able to work with other Rack servers except when using websockets (which will require Iodine due to it's unique websocket support).
18
+
19
+ This means that Plezi will be limited to systems that can run the new version of Iodine (Ruby MRI and Unix based systems, such as Linux and Mac OSX).
20
+
21
+
3
22
  ***
4
23
 
5
24
  Change log v.0.12.21
@@ -168,7 +187,7 @@ Change log v.0.12.3
168
187
 
169
188
  * Websocket Identity API allows you to link a websocket connection with a unique "identity" (i.e., `user.id` or even `session.id`).
170
189
 
171
- This is called "registering", as the identity "registers" and is henceforth recognized.
190
+ This is called "registering", as the identity "registers" and is henceforth recognized.
172
191
 
173
192
  * Notifications sent to the identidy will persist until the identity's "lifetime" expires.
174
193
 
@@ -176,7 +195,7 @@ Change log v.0.12.3
176
195
 
177
196
  * This allows you to send notifications that will "wait" until a user or visitor reconnects and registers the new connection under their Identity.
178
197
 
179
- * This is an alternative to persistant storage, where either visitors messages that aren't read within a certain timespan
198
+ * This is an alternative to persistant storage, where either visitors messages that aren't read within a certain timespan
180
199
 
181
200
  **Fix**: the Placebo API was fixed to correspond with the changes in Iodine's API.
182
201
 
@@ -212,7 +231,7 @@ Change log v.0.12.0 - API changes (throwing out dead code and many more changes)
212
231
 
213
232
  **Feature** The `Controller.failed_unicast(target, method, arguments_array)` callback is here, allowing you to write a class level callback that will be called if `unicast` fails to find it's target (i.e. if the Websocket connection was already closed or the hosting server shutdown).
214
233
 
215
- \* the lack of this callback being called does NOT imply that the unicast was processed without errors, it's only called if the target itself wasn't found (the connection already recognized as closed). Errors can occure within the method originally called by `unicast` when the target was found but the connection was dropped while processing was underway. The `failed_unicast` callback, together with error handling in the original method (i.e. `response << "message"` returning `nil`) should cover any reasonable scenario.
234
+ \* the lack of this callback being called does NOT imply that the unicast was processed without errors, it's only called if the target itself wasn't found (the connection already recognized as closed). Errors can occure within the method originally called by `unicast` when the target was found but the connection was dropped while processing was underway. The `failed_unicast` callback, together with error handling in the original method (i.e. `response << "message"` returning `nil`) should cover any reasonable scenario.
216
235
 
217
236
  **Minor**: updated asset pipeline performance; API for the `Plezi.route` methods now auto-creates an empty listening service (no assets, no templates, no public folder...) if one is missing.
218
237
 
@@ -248,13 +267,13 @@ Change log v.0.11.0
248
267
 
249
268
  **Update**: Requires GRHttp server and GReactor version 0.1.0 or above, adjusted to the updated API.
250
269
 
251
- **Update**: Better pinging and timout support courtesy of the updated GRHttp server.
270
+ **Update**: Better pinging and timout support courtesy of the updated GRHttp server.
252
271
 
253
272
  **Update**: The default number of threads is now 30. It seems that once we move beyond 1 thread (which is also supported), the added threads are adding more security against blocking code without effecting performance as much. It is expected that advanced users will consider moving away from multi-threading to muli-processing while avoiding blocking code. All these options are supported by Plezi, GRHttp and GReactor.
254
273
 
255
274
  **Fix**: Fixed an issue where requests for folders within the assets folder (folder indexing) would fail with an internal error message (error 500) instead of a not found message (error 404).
256
275
 
257
- **Fix**: fixed an issue that caused the static file service to fail when using the preferred `:public` vs. the older `:root` option used to set the public folder's path.
276
+ **Fix**: fixed an issue that caused the static file service to fail when using the preferred `:public` vs. the older `:root` option used to set the public folder's path.
258
277
 
259
278
  **Minor**: minor adjustments and improvements, such as: auto-setting the `content-type` header when using `render`.
260
279
 
@@ -272,7 +291,7 @@ Change log v.0.10.17
272
291
 
273
292
  Change log v.0.10.16
274
293
 
275
- **Fix**: Requires a newer version of the GRHttp server, which fixs an issue with Firefox's websocket implementation.
294
+ **Fix**: Requires a newer version of the GRHttp server, which fixs an issue with Firefox's websocket implementation.
276
295
 
277
296
  **New Feature**: Persistent and synchronized Session data(!) using Redis (if supplied) with a fallback to temporary memory storage. Session lifetime is 5 days.
278
297
 
@@ -829,7 +848,7 @@ Change log v.0.6.5
829
848
 
830
849
  Rack code and Plezi code are NOT fully compatible. for example: Rack's parameters aren't always fully decoded. Also, Rack's file upload contains tmporary files, where Plezi's request object contains the binary data in a binary String object.
831
850
 
832
- Also, Rack does NOT support native WebSocket Controllers (you will need middle ware for that).
851
+ Also, Rack does NOT support native WebSocket Controllers (you will need middle ware for that).
833
852
 
834
853
  ***
835
854
 
@@ -901,7 +920,7 @@ Change log v.0.5.0
901
920
 
902
921
  Change log v.0.4.3
903
922
 
904
- **notice!:** v.0.5.0 might break any code using the `listen :vhost => "foo.bar.com"` format. hosts and aliases will be restructured.
923
+ **notice!:** v.0.5.0 might break any code using the `listen :vhost => "foo.bar.com"` format. hosts and aliases will be restructured.
905
924
 
906
925
  **fix**: an issue with the router was discovered, where non-RESTful Controller methods weren't called for POST, PUT or DELETE http requests. this issue is now fixed, so that non-RESTful methods will be attempted and will exclude ID's with the same value from being created...
907
926
 
@@ -913,7 +932,7 @@ Change log v.0.4.2
913
932
 
914
933
  **error-detection**: Plezi will check that the same port isn't used for to services and will return a warning. a `listen` call with `RackServer` will return an existing router object if a service is already assigned to the requested port.
915
934
 
916
- **notice!:** v.0.5.0 will break any code using the `listen :vhost => "foo.bar.com"` format. hosts and aliases will be restructured.
935
+ **notice!:** v.0.5.0 will break any code using the `listen :vhost => "foo.bar.com"` format. hosts and aliases will be restructured.
917
936
 
918
937
  **fix**: 404 error handler should now be immune to path rewrites (displays originally requested path).
919
938
 
@@ -1074,4 +1093,4 @@ some minor bug fixes.
1074
1093
 
1075
1094
  Change log v.0.2.0
1076
1095
 
1077
- First release that actually works well enough to do something with.
1096
+ First release that actually works well enough to do something with.
data/README.md CHANGED
@@ -4,6 +4,28 @@
4
4
  [![Inline docs](http://inch-ci.org/github/boazsegev/plezi.svg?branch=master)](http://www.rubydoc.info/github/boazsegev/plezi/master)
5
5
  [![GitHub](https://img.shields.io/badge/GitHub-Open%20Source-blue.svg)](https://github.com/boazsegev/plezi)
6
6
 
7
+ ## Special notice - pre version 13
8
+
9
+ One of the best compliments Plezi keeps receiving is the feedback about how easy it is to set up a websocket application using Plezi.
10
+
11
+ On the other hand, Plezi's server, Iodine 0.1.x was written in Ruby and allowed a very fast and easy development...
12
+
13
+ ...but with time and experience we all discovered the Ruby's `select` was limited to ~1024 connections, and that Plezi developers wanted more - more connections, more performance, more ease of deployment and more integration with Rails/Sinatra.
14
+
15
+ I'm working very hard on rewriting the core server in C. Iodine 0.2.x is written in C and it supports only Unix based systems with `kqueue` or `epoll` support (BSD/Linux/MacOSX).
16
+
17
+ This means that if your machine has the memory and the resources (open file descriptor limits apply), Iodine could support tens of thousands of concurrent connections.
18
+
19
+ Also, a lot of the API is changing for better integration with Rack based frameworks (Rails/Sinatra).
20
+
21
+ This also means that some sacrifices will be made. i.e. more Rack integration means that we loose HTTP streaming (Rack's specifications have their limits).
22
+
23
+ This is where you come in. **Now** is the time to push those changes you wanted to integrate into Plezi. Send in your thoughts and feedback. You can open an issue or email me. Just write about how you use Plezi and what features you think are super important to keep and which once bother you.
24
+
25
+ Even if I cannot answer everyone, it will all go into the next version's design and I'll do my best.
26
+
27
+ ## Plezi
28
+
7
29
  Plezi is a Ruby framework for realtime web applications. It's name comes from the word "pleasure", since Plezi is a pleasure to work with.
8
30
 
9
31
  With Plezi, you can easily:
@@ -16,7 +38,7 @@ With Plezi, you can easily:
16
38
 
17
39
  ## Guides and documentation
18
40
 
19
- You can find [tutorials and guides at Plezi.io](http://www.plezi.io/guides).
41
+ You can find [tutorials and guides at Plezi.io](http://www.plezi.io/docs).
20
42
 
21
43
  Plezi leverages Ruby's mixins and meta-programming, so the YARD documentation is hard to navigate... I started writing guides for Plezi and would really appreciate any help you can offer.
22
44
 
@@ -36,7 +58,7 @@ Or install it yourself as:
36
58
 
37
59
  ## Quick start
38
60
 
39
- Plezi is super easy. Please read our [Getting Started guide](http://www.plezi.io/guides/basics) for more information.
61
+ Plezi is super easy. Please read our [Getting Started guide](http://www.plezi.io/docs/basics) for more information.
40
62
 
41
63
  Here's a super quick intro:
42
64
 
@@ -709,7 +731,7 @@ The following is safe:
709
731
  Plezi.get_cached :global_hash do |global_hash|
710
732
  global_hash[:change] = "safe"
711
733
  end
712
-
734
+
713
735
  However, the following is unsafe:
714
736
 
715
737
  # set data
@@ -717,7 +739,7 @@ However, the following is unsafe:
717
739
  # manipulate data
718
740
  global_hash = Plezi.get_cached :global_hash do |global_hash|
719
741
  global_hash[:change] = "NOT safe"
720
-
742
+
721
743
 
722
744
  \* be aware, if using Plezi in as a multi-process application, that each process has it's own cache and that processes can't share the cache. The different threads in each of the processes will be able to access their process's cache, but each process runs in a different memory space, so they can't share.
723
745
 
@@ -62,7 +62,7 @@ module Plezi
62
62
  return true if Plezi.cache_needs_update?(sass)
63
63
  # return false unless Plezi.allow_cache_update? # no meaningful performance boost.
64
64
  mt = Plezi.file_mtime(sass)
65
- Plezi.get_cached(sass).each {|e| return true if File.exists?(e.options[:filename]) && (File.mtime(e.options[:filename]) > mt)} # fn = File.join( e.options[:load_paths][0].root, e.options[:filename])
65
+ Plezi.get_cached(sass).each {|e| return true if File.exists?(e.options[:filename]) && (File.mtime(e.options[:filename]) > mt)} # fn = File.join( e.options[:load_paths][0].root, e.options[:filename])
66
66
  false
67
67
  end
68
68
  end
@@ -76,7 +76,7 @@ module Plezi
76
76
  module_function
77
77
  # Registers a rendering extention for a specific asset type (js, css, etc').
78
78
  #
79
- # type:: the type of
79
+ # type:: the type of
80
80
  # extention:: a Symbol or String representing the extention of the file to be rendered. i.e. 'scss', 'sass', 'coffee', etc'
81
81
  # handler :: a Proc or other object that answers to call(filename, context, &block) and returnes the rendered string. The block accepted by the handler is for chaining rendered actions (allowing for `yield` within templates) and the context is a Binding object which is offered to the rendering (if `binding` handling is supported by the engine).
82
82
  #
@@ -116,22 +116,22 @@ module Plezi
116
116
 
117
117
  Renderer.register :erb do |filename, context, &block|
118
118
  next unless defined? ::ERB
119
- ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( ERB.new( IO.binread(filename) ) ) ) : (Plezi.get_cached filename) ).result((context) , &block)
119
+ ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( ERB.new( Plezi::Base::Helpers.try_utf8! IO.binread(filename) ) ) ) : (Plezi.get_cached filename) ).result((context) , &block)
120
120
  end
121
121
  Renderer.register :slim do |filename, context, &block|
122
122
  next unless defined? ::Slim
123
- ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( Slim::Template.new() { IO.binread filename } ) ) : (Plezi.get_cached filename) ).render(context.receiver, &block)
123
+ ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( Slim::Template.new() { Plezi::Base::Helpers.try_utf8! IO.binread(filename) } ) ) : (Plezi.get_cached filename) ).render(context.receiver, &block)
124
124
  end
125
125
  Renderer.register :haml do |filename, context, &block|
126
126
  next unless defined? ::Haml
127
- ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( Haml::Engine.new( IO.binread(filename) ) ) ) : (Plezi.get_cached filename) ).render(context.receiver, &block)
127
+ ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, ( Haml::Engine.new( Plezi::Base::Helpers.try_utf8! IO.binread(filename) ) ) ) : (Plezi.get_cached filename) ).render(context.receiver, &block)
128
128
  end
129
129
 
130
130
  # JavaScript asset rendering
131
131
  AssetManager.register :js, :erb, Renderer.review(:erb)
132
132
  AssetManager.register :js, :coffee do |filename, context, &block|
133
133
  next unless defined? ::CoffeeScript
134
- ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, CoffeeScript.compile(IO.binread filename) ) : (Plezi.get_cached filename) )
134
+ ( Plezi.cache_needs_update?(filename) ? Plezi.cache_data( filename, CoffeeScript.compile(Plezi::Base::Helpers.try_utf8!(IO.binread(filename))) ) : (Plezi.get_cached filename) )
135
135
  end
136
136
 
137
137
  # CSS asset rendering
@@ -3,6 +3,10 @@ module Plezi
3
3
 
4
4
  # the methods defined in this module will be injected into the Controller's Core class (inherited from the controller).
5
5
  module ControllerCore
6
+ # @!parse include Plezi::Base::WSObject
7
+ # @!parse include InstanceMethods
8
+ # @!parse extend ClassMethods
9
+
6
10
  def self.included base
7
11
  base.send :include, Plezi::Base::WSObject
8
12
  base.send :include, InstanceMethods
@@ -20,6 +20,10 @@ module Plezi
20
20
  # {include: Plezi::ControllerMagic::InstanceMethods}
21
21
  #
22
22
  module ControllerMagic
23
+ # @!parse include Plezi::Base::WSObject
24
+ # @!parse include InstanceMethods
25
+ # @!parse extend ClassMethods
26
+
23
27
  def self.included base
24
28
  base.send :include, InstanceMethods
25
29
  base.extend ClassMethods
@@ -1,3 +1,3 @@
1
1
  module Plezi
2
- VERSION = "0.12.21"
2
+ VERSION = "0.12.22"
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Plezi::VERSION
9
9
  spec.authors = ["Boaz Segev"]
10
10
  spec.email = ['boaz@2be.co.il']
11
- spec.summary = %q{Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming serviced to Ruby Web-Apps.}
12
- spec.description = %q{Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming serviced to Ruby Web-Apps.}
11
+ spec.summary = %q{Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming services to Ruby Web-Apps.}
12
+ spec.description = %q{Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming services to Ruby Web-Apps.}
13
13
  spec.homepage = "http://www.plezi.io/"
14
14
  spec.license = "MIT"
15
15
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "iodine", "~> 0.1.19"
21
+ spec.add_dependency "iodine", "~> 0.1.20"
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
 
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ $LOAD_PATH.unshift File.expand_path(File.join('..', '..', 'lib'), __FILE__ )
5
+ require "plezi"
6
+
7
+ Iodine.logger = nil
8
+
9
+ HELLO = 'Hello Plezi'
10
+ Plezi.route('*') { HELLO }
11
+
12
+ # ab -n 10000 -c 200 -k http://127.0.0.1:3000/
13
+ # ~/ruby/wrk/wrk -c400 -d10 -t12 http://localhost:3000/
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.12.21
4
+ version: 0.12.22
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-12-08 00:00:00.000000000 Z
11
+ date: 2016-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iodine
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.19
19
+ version: 0.1.20
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.19
26
+ version: 0.1.20
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  description: Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming
56
- serviced to Ruby Web-Apps.
56
+ services to Ruby Web-Apps.
57
57
  email:
58
58
  - boaz@2be.co.il
59
59
  executables:
@@ -140,6 +140,7 @@ files:
140
140
  - resources/welcome_page.html
141
141
  - test/console
142
142
  - test/dispatch
143
+ - test/hello_world
143
144
  - test/plezi_tests.rb
144
145
  homepage: http://www.plezi.io/
145
146
  licenses:
@@ -162,13 +163,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  version: '0'
163
164
  requirements: []
164
165
  rubyforge_project:
165
- rubygems_version: 2.4.5.1
166
+ rubygems_version: 2.5.1
166
167
  signing_key:
167
168
  specification_version: 4
168
169
  summary: Plezi - the easy way to add Websockets, RESTful routing and HTTP streaming
169
- serviced to Ruby Web-Apps.
170
+ services to Ruby Web-Apps.
170
171
  test_files:
171
172
  - test/console
172
173
  - test/dispatch
174
+ - test/hello_world
173
175
  - test/plezi_tests.rb
174
176
  has_rdoc: