plezi 0.11.2 → 0.12.0
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/CHANGELOG.md +20 -0
- data/README.md +32 -33
- data/docs/async_helpers.md +90 -40
- data/docs/logging.md +38 -3
- data/docs/routes.md +177 -5
- data/docs/websockets.md +5 -0
- data/lib/plezi.rb +2 -10
- data/lib/plezi/common/api.rb +48 -101
- data/lib/plezi/common/defer.rb +4 -4
- data/lib/plezi/common/dsl.rb +13 -24
- data/lib/plezi/common/redis.rb +9 -5
- data/lib/plezi/common/settings.rb +4 -24
- data/lib/plezi/handlers/controller_core.rb +7 -14
- data/lib/plezi/handlers/controller_magic.rb +12 -10
- data/lib/plezi/handlers/http_router.rb +27 -22
- data/lib/plezi/handlers/placebo.rb +40 -33
- data/lib/plezi/handlers/route.rb +233 -234
- data/lib/plezi/handlers/session.rb +2 -2
- data/lib/plezi/handlers/stubs.rb +7 -0
- data/lib/plezi/handlers/ws_object.rb +25 -15
- data/lib/plezi/helpers/http_sender.rb +3 -3
- data/lib/plezi/helpers/magic_helpers.rb +3 -3
- data/lib/plezi/version.rb +1 -1
- data/plezi.gemspec +1 -1
- data/resources/config.ru +12 -18
- data/resources/environment.rb +6 -7
- data/resources/mini_app.rb +22 -22
- data/resources/redis_config.rb +4 -2
- data/test/plezi_tests.rb +76 -87
- data/websocket chatroom.md +3 -5
- metadata +6 -6
- data/docs/http_helpers.md +0 -9
data/websocket chatroom.md
CHANGED
@@ -95,16 +95,14 @@ service_options = {
|
|
95
95
|
}
|
96
96
|
```
|
97
97
|
|
98
|
-
Next we call the `
|
98
|
+
Next we call the `host` command - this command sets up some of the host options we will need, such as the templates folder. We will use only the main host for now (the catch-all main host is the `:default` host)
|
99
99
|
|
100
100
|
The port plezi uses by default is either 3000 [http://localhost:3000/](http://localhost:3000/) or the port defined when calling the script (i.e. `./mychat.rb -p 8080`).
|
101
101
|
|
102
102
|
```ruby
|
103
|
-
|
103
|
+
host :default, service_options
|
104
104
|
```
|
105
105
|
|
106
|
-
(if you want to force a specific port, i.e. 80, write `listen service_options.merge(port: 80)` - but make sure you are allowed to use this port)
|
107
|
-
|
108
106
|
Last, but not least, we tell Plezi to connect the root of our web application to our ChatController - in other words, make sure the root _path_ ('/') is connected to the ChatController class.
|
109
107
|
|
110
108
|
```ruby
|
@@ -486,7 +484,7 @@ service_options = {
|
|
486
484
|
ssl: false
|
487
485
|
}
|
488
486
|
|
489
|
-
|
487
|
+
host :default, service_options
|
490
488
|
|
491
489
|
# this routes the root of the application ('/') to our ChatController
|
492
490
|
route '/:id', ChatController
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plezi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
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-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: iodine
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.0
|
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.
|
26
|
+
version: 0.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- Rakefile
|
71
71
|
- bin/plezi
|
72
72
|
- docs/async_helpers.md
|
73
|
-
- docs/http_helpers.md
|
74
73
|
- docs/logging.md
|
75
74
|
- docs/routes.md
|
76
75
|
- docs/websockets.md
|
@@ -163,3 +162,4 @@ summary: Plezi - the easy way to add Websockets, RESTful routing and HTTP stream
|
|
163
162
|
test_files:
|
164
163
|
- test/console
|
165
164
|
- test/plezi_tests.rb
|
165
|
+
has_rdoc:
|
data/docs/http_helpers.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# HTTP Helpers inherited from GRHttp
|
2
|
-
|
3
|
-
Inside Plezi's core code is a pure Ruby HTTP and Websocket Server (and client) called [GRHttp](https://github.com/boazsegev/GRHttp) (Generic HTTP), a very powerful server that [isn't limited by Rack's API](https://github.com/boazsegev/GRHttp/blob/master/HTTP.md).
|
4
|
-
|
5
|
-
|
6
|
-
(todo: write documentation)
|
7
|
-
|
8
|
-
|
9
|
-
|