rocketio 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -5
- data/.pryrc +2 -0
- data/.travis.yml +3 -0
- data/README.md +22 -5
- data/Rakefile +7 -1
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/rocketio.rb +131 -3
- data/lib/rocketio/application.rb +31 -0
- data/lib/rocketio/controller.rb +288 -0
- data/lib/rocketio/controller/authentication.rb +141 -0
- data/lib/rocketio/controller/authorization.rb +53 -0
- data/lib/rocketio/controller/cookies.rb +59 -0
- data/lib/rocketio/controller/error_handlers.rb +89 -0
- data/lib/rocketio/controller/filters.rb +119 -0
- data/lib/rocketio/controller/flash.rb +21 -0
- data/lib/rocketio/controller/helpers.rb +438 -0
- data/lib/rocketio/controller/middleware.rb +32 -0
- data/lib/rocketio/controller/render.rb +148 -0
- data/lib/rocketio/controller/render/engine.rb +76 -0
- data/lib/rocketio/controller/render/layout.rb +27 -0
- data/lib/rocketio/controller/render/layouts.rb +85 -0
- data/lib/rocketio/controller/render/templates.rb +83 -0
- data/lib/rocketio/controller/request.rb +115 -0
- data/lib/rocketio/controller/response.rb +84 -0
- data/lib/rocketio/controller/sessions.rb +64 -0
- data/lib/rocketio/controller/token_auth.rb +118 -0
- data/lib/rocketio/controller/websocket.rb +21 -0
- data/lib/rocketio/error_templates/404.html +3 -0
- data/lib/rocketio/error_templates/409.html +7 -0
- data/lib/rocketio/error_templates/500.html +3 -0
- data/lib/rocketio/error_templates/501.html +6 -0
- data/lib/rocketio/error_templates/layout.html +1 -0
- data/lib/rocketio/exceptions.rb +4 -0
- data/lib/rocketio/router.rb +65 -0
- data/lib/rocketio/util.rb +122 -0
- data/lib/rocketio/version.rb +2 -2
- data/rocketio.gemspec +21 -17
- data/test/aliases_test.rb +54 -0
- data/test/authentication_test.rb +307 -0
- data/test/authorization_test.rb +91 -0
- data/test/cache_control_test.rb +268 -0
- data/test/content_type_test.rb +124 -0
- data/test/cookies_test.rb +49 -0
- data/test/error_handlers_test.rb +125 -0
- data/test/etag_test.rb +445 -0
- data/test/filters_test.rb +177 -0
- data/test/halt_test.rb +73 -0
- data/test/helpers_test.rb +171 -0
- data/test/middleware_test.rb +57 -0
- data/test/redirect_test.rb +135 -0
- data/test/render/engine_test.rb +71 -0
- data/test/render/get.erb +1 -0
- data/test/render/items.erb +1 -0
- data/test/render/layout.erb +1 -0
- data/test/render/layout_test.rb +104 -0
- data/test/render/layouts/master.erb +1 -0
- data/test/render/layouts_test.rb +145 -0
- data/test/render/master.erb +1 -0
- data/test/render/post.erb +1 -0
- data/test/render/put.erb +1 -0
- data/test/render/render_test.rb +101 -0
- data/test/render/setup.rb +14 -0
- data/test/render/templates/a/get.erb +1 -0
- data/test/render/templates/master.erb +1 -0
- data/test/render/templates_test.rb +146 -0
- data/test/request_test.rb +105 -0
- data/test/response_test.rb +119 -0
- data/test/routes_test.rb +70 -0
- data/test/sendfile_test.rb +209 -0
- data/test/sessions_test.rb +176 -0
- data/test/setup.rb +59 -0
- metadata +144 -9
- data/LICENSE.txt +0 -22
data/test/setup.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
ENV['RACK_ENV'] = 'testing'
|
2
|
+
require 'rack/radar'
|
3
|
+
$:.unshift(File.expand_path('../../lib', __FILE__))
|
4
|
+
require 'rocketio'
|
5
|
+
|
6
|
+
spec do
|
7
|
+
include Rack::Radar
|
8
|
+
|
9
|
+
def mock_app *controllers
|
10
|
+
RocketIO::Application.new(controllers)
|
11
|
+
end
|
12
|
+
|
13
|
+
def mock_controller path = :/, superclass = nil, &block
|
14
|
+
path, superclass = :/, path if path.is_a?(Class)
|
15
|
+
controller = Class.new(superclass || RocketIO::Controller)
|
16
|
+
controller.map(path)
|
17
|
+
controller.class_exec(&block) if block
|
18
|
+
controller
|
19
|
+
end
|
20
|
+
|
21
|
+
assert :ok, :is_ok do |response|
|
22
|
+
response.status == 200
|
23
|
+
end
|
24
|
+
|
25
|
+
assert :ok_with_body, :is_ok_with_body do |response,body|
|
26
|
+
response.status == 200 && response.body == body
|
27
|
+
end
|
28
|
+
|
29
|
+
assert :is_unimplemented do |response|
|
30
|
+
response.status == 501
|
31
|
+
end
|
32
|
+
|
33
|
+
assert :is_unauthorized do |response|
|
34
|
+
response.status == 401
|
35
|
+
end
|
36
|
+
|
37
|
+
assert :is_authorized do |response|
|
38
|
+
response.status != 401
|
39
|
+
end
|
40
|
+
|
41
|
+
assert :is_not_modified do |response|
|
42
|
+
response.status == 304
|
43
|
+
response.body == ''
|
44
|
+
end
|
45
|
+
|
46
|
+
assert :is_precondition_failed do |response|
|
47
|
+
response.status == 412
|
48
|
+
response.body == ''
|
49
|
+
end
|
50
|
+
|
51
|
+
assert :is_errored do |response|
|
52
|
+
response.status == 500
|
53
|
+
end
|
54
|
+
|
55
|
+
assert :returned do |response, status, body|
|
56
|
+
response.status == status
|
57
|
+
response.body == body if body
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slee Woo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mustache
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: tilt
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2'
|
13
55
|
- !ruby/object:Gem::Dependency
|
14
56
|
name: bundler
|
15
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,7 +80,35 @@ dependencies:
|
|
38
80
|
- - "~>"
|
39
81
|
- !ruby/object:Gem::Version
|
40
82
|
version: '10.0'
|
41
|
-
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tokyo
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rack-radar
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Simple, fast, scalable web framework for Ruby
|
42
112
|
email:
|
43
113
|
- mail@sleewoo.com
|
44
114
|
executables: []
|
@@ -46,14 +116,79 @@ extensions: []
|
|
46
116
|
extra_rdoc_files: []
|
47
117
|
files:
|
48
118
|
- ".gitignore"
|
119
|
+
- ".pryrc"
|
120
|
+
- ".travis.yml"
|
49
121
|
- Gemfile
|
50
|
-
- LICENSE.txt
|
51
122
|
- README.md
|
52
123
|
- Rakefile
|
124
|
+
- bin/console
|
125
|
+
- bin/setup
|
53
126
|
- lib/rocketio.rb
|
127
|
+
- lib/rocketio/application.rb
|
128
|
+
- lib/rocketio/controller.rb
|
129
|
+
- lib/rocketio/controller/authentication.rb
|
130
|
+
- lib/rocketio/controller/authorization.rb
|
131
|
+
- lib/rocketio/controller/cookies.rb
|
132
|
+
- lib/rocketio/controller/error_handlers.rb
|
133
|
+
- lib/rocketio/controller/filters.rb
|
134
|
+
- lib/rocketio/controller/flash.rb
|
135
|
+
- lib/rocketio/controller/helpers.rb
|
136
|
+
- lib/rocketio/controller/middleware.rb
|
137
|
+
- lib/rocketio/controller/render.rb
|
138
|
+
- lib/rocketio/controller/render/engine.rb
|
139
|
+
- lib/rocketio/controller/render/layout.rb
|
140
|
+
- lib/rocketio/controller/render/layouts.rb
|
141
|
+
- lib/rocketio/controller/render/templates.rb
|
142
|
+
- lib/rocketio/controller/request.rb
|
143
|
+
- lib/rocketio/controller/response.rb
|
144
|
+
- lib/rocketio/controller/sessions.rb
|
145
|
+
- lib/rocketio/controller/token_auth.rb
|
146
|
+
- lib/rocketio/controller/websocket.rb
|
147
|
+
- lib/rocketio/error_templates/404.html
|
148
|
+
- lib/rocketio/error_templates/409.html
|
149
|
+
- lib/rocketio/error_templates/500.html
|
150
|
+
- lib/rocketio/error_templates/501.html
|
151
|
+
- lib/rocketio/error_templates/layout.html
|
152
|
+
- lib/rocketio/exceptions.rb
|
153
|
+
- lib/rocketio/router.rb
|
154
|
+
- lib/rocketio/util.rb
|
54
155
|
- lib/rocketio/version.rb
|
55
156
|
- rocketio.gemspec
|
56
|
-
|
157
|
+
- test/aliases_test.rb
|
158
|
+
- test/authentication_test.rb
|
159
|
+
- test/authorization_test.rb
|
160
|
+
- test/cache_control_test.rb
|
161
|
+
- test/content_type_test.rb
|
162
|
+
- test/cookies_test.rb
|
163
|
+
- test/error_handlers_test.rb
|
164
|
+
- test/etag_test.rb
|
165
|
+
- test/filters_test.rb
|
166
|
+
- test/halt_test.rb
|
167
|
+
- test/helpers_test.rb
|
168
|
+
- test/middleware_test.rb
|
169
|
+
- test/redirect_test.rb
|
170
|
+
- test/render/engine_test.rb
|
171
|
+
- test/render/get.erb
|
172
|
+
- test/render/items.erb
|
173
|
+
- test/render/layout.erb
|
174
|
+
- test/render/layout_test.rb
|
175
|
+
- test/render/layouts/master.erb
|
176
|
+
- test/render/layouts_test.rb
|
177
|
+
- test/render/master.erb
|
178
|
+
- test/render/post.erb
|
179
|
+
- test/render/put.erb
|
180
|
+
- test/render/render_test.rb
|
181
|
+
- test/render/setup.rb
|
182
|
+
- test/render/templates/a/get.erb
|
183
|
+
- test/render/templates/master.erb
|
184
|
+
- test/render/templates_test.rb
|
185
|
+
- test/request_test.rb
|
186
|
+
- test/response_test.rb
|
187
|
+
- test/routes_test.rb
|
188
|
+
- test/sendfile_test.rb
|
189
|
+
- test/sessions_test.rb
|
190
|
+
- test/setup.rb
|
191
|
+
homepage: https://github.com/rocketio/rocketio
|
57
192
|
licenses:
|
58
193
|
- MIT
|
59
194
|
metadata: {}
|
@@ -63,9 +198,9 @@ require_paths:
|
|
63
198
|
- lib
|
64
199
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
200
|
requirements:
|
66
|
-
- - "
|
201
|
+
- - "~>"
|
67
202
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
203
|
+
version: '2.0'
|
69
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
205
|
requirements:
|
71
206
|
- - ">="
|
@@ -73,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
208
|
version: '0'
|
74
209
|
requirements: []
|
75
210
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.4.5.1
|
77
212
|
signing_key:
|
78
213
|
specification_version: 4
|
79
|
-
summary:
|
214
|
+
summary: '["rocketio-0.0.1", "Simple, fast, scalable web framework for Ruby"]'
|
80
215
|
test_files: []
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Slee Woo
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|