nyara 0.1.pre.0 → 0.1.pre.1
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/bin/nyara +2 -14
- data/changes +3 -0
- data/example/factorial.rb +19 -0
- data/example/hello.rb +5 -0
- data/example/project.rb +11 -0
- data/example/stream.rb +14 -0
- data/ext/extconf.rb +19 -0
- data/ext/hashes.c +160 -57
- data/ext/inc/ary_intern.h +36 -0
- data/ext/route.cc +2 -1
- data/ext/url_encoded.c +1 -0
- data/lib/nyara.rb +1 -0
- data/lib/nyara/command.rb +60 -79
- data/lib/nyara/config.rb +19 -1
- data/lib/nyara/controller.rb +64 -7
- data/lib/nyara/hashes/config_hash.rb +3 -20
- data/lib/nyara/hashes/header_hash.rb +2 -2
- data/lib/nyara/hashes/param_hash.rb +1 -0
- data/lib/nyara/nyara.rb +45 -37
- data/lib/nyara/part.rb +2 -2
- data/lib/nyara/reload.rb +63 -64
- data/lib/nyara/route.rb +7 -6
- data/lib/nyara/session.rb +4 -0
- data/lib/nyara/templates/{Gemfile → Gemfile.tt} +4 -0
- data/lib/nyara/templates/Linnerfile +28 -0
- data/lib/nyara/templates/Rakefile +16 -2
- data/lib/nyara/templates/app/assets/files/favicon.ico +1 -0
- data/lib/nyara/templates/app/assets/files/robots.txt +5 -0
- data/lib/nyara/templates/app/assets/scripts/app.coffee +4 -0
- data/lib/nyara/templates/app/assets/scripts/module-example.coffee +4 -0
- data/lib/nyara/templates/app/assets/styles/app.scss +2 -0
- data/lib/nyara/templates/app/controllers/application_controller.rb +8 -0
- data/lib/nyara/templates/app/views/layouts/application.erb.tt +12 -0
- data/lib/nyara/templates/config/application.rb +4 -0
- data/lib/nyara/templates/config/{database.yml → database.yml.tt} +3 -3
- data/lib/nyara/templates/config/production.rb +2 -0
- data/lib/nyara/view.rb +6 -2
- data/nyara.gemspec +3 -1
- data/rakefile +7 -26
- data/spec/apps/reload.rb +35 -0
- data/spec/command_spec.rb +24 -10
- data/spec/config_spec.rb +19 -8
- data/spec/controller_spec.rb +14 -0
- data/spec/evented_io_spec.rb +3 -1
- data/spec/ext_route_spec.rb +25 -3
- data/spec/hashes_spec.rb +45 -21
- data/spec/integration_spec.rb +28 -2
- data/spec/path_helper_spec.rb +7 -0
- data/spec/performance_spec.rb +1 -1
- data/spec/public/test.css +1 -0
- data/{lib/nyara/templates/public/robot.txt → spec/public/test.jpg} +0 -0
- data/spec/public/test.js +1 -0
- data/spec/reload_spec.rb +50 -0
- data/spec/route_spec.rb +4 -4
- data/spec/spec_helper.rb +15 -9
- data/spec/url_encoded_spec.rb +5 -0
- data/spec/view_spec.rb +7 -0
- data/spec/views/_partial.slim +1 -1
- data/tools/bug.rb +53 -0
- data/tools/hello.rb +49 -0
- data/tools/memcheck.rb +33 -0
- metadata +73 -41
- data/ext/inc/status_codes.inc +0 -64
- data/lib/nyara/templates/app/views/layouts/application.erb +0 -12
- data/lib/nyara/templates/public/css/app.css +0 -1
- data/lib/nyara/templates/public/js/app.js +0 -1
data/tools/memcheck.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative "../lib/nyara/nyara"
|
2
|
+
|
3
|
+
module Nyara
|
4
|
+
class SimpleController < Controller
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
%w[on tag get post put delete patch options].each do |m|
|
9
|
+
eval <<-RUBY
|
10
|
+
def #{m} *xs, &blk
|
11
|
+
Nyara::SimpleController.#{m} *xs, &blk
|
12
|
+
end
|
13
|
+
RUBY
|
14
|
+
end
|
15
|
+
|
16
|
+
configure do
|
17
|
+
map '/', 'nyara::simple'
|
18
|
+
end
|
19
|
+
|
20
|
+
get '/' do
|
21
|
+
send_string 'hello world'
|
22
|
+
end
|
23
|
+
|
24
|
+
get '/gc' do
|
25
|
+
GC.stress = true
|
26
|
+
end
|
27
|
+
|
28
|
+
get '/ngc' do
|
29
|
+
GC.stress = false
|
30
|
+
end
|
31
|
+
|
32
|
+
Nyara.setup
|
33
|
+
Nyara.start_server
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.pre.
|
4
|
+
version: 0.1.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zete Lui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.1.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.18'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.18'
|
41
55
|
description: Fast and fuzzy ruby web framework + server
|
42
56
|
email: nobody@example.com
|
43
57
|
executables:
|
@@ -51,24 +65,23 @@ files:
|
|
51
65
|
- readme.md
|
52
66
|
- copying
|
53
67
|
- changes
|
68
|
+
- example/factorial.rb
|
69
|
+
- example/hello.rb
|
70
|
+
- example/project.rb
|
71
|
+
- example/stream.rb
|
54
72
|
- ext/extconf.rb
|
55
|
-
- lib/nyara.rb
|
56
|
-
- lib/nyara/config.rb
|
57
73
|
- lib/nyara/command.rb
|
74
|
+
- lib/nyara/config.rb
|
58
75
|
- lib/nyara/controller.rb
|
59
76
|
- lib/nyara/cookie.rb
|
60
77
|
- lib/nyara/cpu_counter.rb
|
61
78
|
- lib/nyara/flash.rb
|
62
|
-
- lib/nyara/mime_types.rb
|
63
|
-
- lib/nyara/nyara.rb
|
64
79
|
- lib/nyara/hashes/config_hash.rb
|
65
80
|
- lib/nyara/hashes/header_hash.rb
|
66
81
|
- lib/nyara/hashes/param_hash.rb
|
67
|
-
- lib/nyara/
|
68
|
-
- lib/nyara/
|
82
|
+
- lib/nyara/mime_types.rb
|
83
|
+
- lib/nyara/nyara.rb
|
69
84
|
- lib/nyara/part.rb
|
70
|
-
- lib/nyara/session.rb
|
71
|
-
- lib/nyara/view.rb
|
72
85
|
- lib/nyara/patches/array.rb
|
73
86
|
- lib/nyara/patches/blank.rb
|
74
87
|
- lib/nyara/patches/json.rb
|
@@ -77,6 +90,9 @@ files:
|
|
77
90
|
- lib/nyara/patches/tcp_socket.rb
|
78
91
|
- lib/nyara/patches/to_query.rb
|
79
92
|
- lib/nyara/reload.rb
|
93
|
+
- lib/nyara/request.rb
|
94
|
+
- lib/nyara/route.rb
|
95
|
+
- lib/nyara/session.rb
|
80
96
|
- lib/nyara/templates/app/controllers/application_controller.rb
|
81
97
|
- lib/nyara/templates/app/controllers/welcome_controller.rb
|
82
98
|
- lib/nyara/templates/config/application.rb
|
@@ -86,46 +102,54 @@ files:
|
|
86
102
|
- lib/nyara/templates/config/test.rb
|
87
103
|
- lib/nyara/templates/spec/spec_helper.rb
|
88
104
|
- lib/nyara/test.rb
|
105
|
+
- lib/nyara/view.rb
|
89
106
|
- lib/nyara/view_handlers/erb.rb
|
90
107
|
- lib/nyara/view_handlers/erubis.rb
|
91
108
|
- lib/nyara/view_handlers/haml.rb
|
92
109
|
- lib/nyara/view_handlers/slim.rb
|
93
|
-
-
|
94
|
-
- spec/ext_parse_accept_value_spec.rb
|
110
|
+
- lib/nyara.rb
|
95
111
|
- spec/apps/connect.rb
|
96
|
-
- spec/
|
97
|
-
- spec/dummy/app/models/dmmy_model.rb
|
98
|
-
- spec/ext_route_spec.rb
|
99
|
-
- spec/hashes_spec.rb
|
100
|
-
- spec/path_helper_spec.rb
|
101
|
-
- spec/request_delegate_spec.rb
|
102
|
-
- spec/request_spec.rb
|
112
|
+
- spec/apps/reload.rb
|
103
113
|
- spec/command_spec.rb
|
104
|
-
- spec/route_spec.rb
|
105
|
-
- spec/session_spec.rb
|
106
|
-
- spec/spec_helper.rb
|
107
|
-
- spec/view_spec.rb
|
108
114
|
- spec/config_spec.rb
|
109
115
|
- spec/controller_spec.rb
|
110
116
|
- spec/cpu_counter_spec.rb
|
117
|
+
- spec/dummy/app/controllers/dummy_controller.rb
|
118
|
+
- spec/dummy/app/models/dmmy_model.rb
|
111
119
|
- spec/evented_io_spec.rb
|
120
|
+
- spec/ext_mime_match_spec.rb
|
121
|
+
- spec/ext_parse_accept_value_spec.rb
|
122
|
+
- spec/ext_route_spec.rb
|
112
123
|
- spec/flash_spec.rb
|
124
|
+
- spec/hashes_spec.rb
|
113
125
|
- spec/integration_spec.rb
|
114
126
|
- spec/mini_support_spec.rb
|
115
127
|
- spec/multipart_spec.rb
|
128
|
+
- spec/path_helper_spec.rb
|
116
129
|
- spec/performance/escape.rb
|
117
130
|
- spec/performance/layout_render.rb
|
118
131
|
- spec/performance/parse_accept_value.rb
|
119
132
|
- spec/performance/parse_param.rb
|
120
133
|
- spec/performance/performance_helper.rb
|
121
134
|
- spec/performance_spec.rb
|
135
|
+
- spec/reload_spec.rb
|
136
|
+
- spec/request_delegate_spec.rb
|
137
|
+
- spec/request_spec.rb
|
138
|
+
- spec/route_spec.rb
|
139
|
+
- spec/session_spec.rb
|
140
|
+
- spec/spec_helper.rb
|
122
141
|
- spec/url_encoded_spec.rb
|
142
|
+
- spec/view_spec.rb
|
143
|
+
- tools/bug.rb
|
144
|
+
- tools/hello.rb
|
145
|
+
- tools/memcheck.rb
|
123
146
|
- ext/http-parser/http_parser.h
|
147
|
+
- ext/inc/ary_intern.h
|
124
148
|
- ext/inc/epoll.h
|
125
149
|
- ext/inc/kqueue.h
|
126
|
-
- ext/inc/str_intern.h
|
127
150
|
- ext/inc/rdtsc.h
|
128
151
|
- ext/inc/status_codes.h
|
152
|
+
- ext/inc/str_intern.h
|
129
153
|
- ext/multipart-parser-c/multipart_parser.h
|
130
154
|
- ext/nyara.h
|
131
155
|
- ext/request.h
|
@@ -142,37 +166,42 @@ files:
|
|
142
166
|
- ext/multipart_parser.c
|
143
167
|
- ext/nyara.c
|
144
168
|
- ext/request.c
|
145
|
-
- ext/url_encoded.c
|
146
169
|
- ext/request_parse.c
|
147
170
|
- ext/test_response.c
|
171
|
+
- ext/url_encoded.c
|
148
172
|
- ext/route.cc
|
149
|
-
- ext/inc/status_codes.inc
|
150
173
|
- ext/inc/version.inc
|
174
|
+
- spec/performance/layout.slim
|
175
|
+
- spec/performance/page.slim
|
176
|
+
- spec/public/empty file.html
|
177
|
+
- spec/public/index.html
|
178
|
+
- spec/public/test.css
|
179
|
+
- spec/public/test.jpg
|
180
|
+
- spec/public/test.js
|
181
|
+
- spec/raw_requests/multipart
|
182
|
+
- spec/views/_partial.slim
|
183
|
+
- spec/views/_partial_with_yield.erb
|
151
184
|
- spec/views/edit.haml
|
152
185
|
- spec/views/edit.slim
|
153
186
|
- spec/views/index.liquid
|
154
187
|
- spec/views/invalid_layout.liquid
|
155
188
|
- spec/views/layout.erb
|
156
189
|
- spec/views/show.slim
|
157
|
-
- spec/views/_partial.slim
|
158
|
-
- spec/views/_partial_with_yield.erb
|
159
|
-
- spec/performance/layout.slim
|
160
|
-
- spec/performance/page.slim
|
161
|
-
- spec/public/empty file.html
|
162
|
-
- spec/public/index.html
|
163
|
-
- spec/raw_requests/multipart
|
164
190
|
- ext/http-parser/AUTHORS
|
165
191
|
- ext/http-parser/CONTRIBUTIONS
|
166
192
|
- ext/http-parser/LICENSE-MIT
|
167
193
|
- ext/multipart-parser-c/README.md
|
168
|
-
- lib/nyara/templates/
|
169
|
-
- lib/nyara/templates/
|
170
|
-
- lib/nyara/templates/app/
|
194
|
+
- lib/nyara/templates/app/assets/files/favicon.ico
|
195
|
+
- lib/nyara/templates/app/assets/files/robots.txt
|
196
|
+
- lib/nyara/templates/app/assets/scripts/app.coffee
|
197
|
+
- lib/nyara/templates/app/assets/scripts/module-example.coffee
|
198
|
+
- lib/nyara/templates/app/assets/styles/app.scss
|
199
|
+
- lib/nyara/templates/app/views/layouts/application.erb.tt
|
171
200
|
- lib/nyara/templates/app/views/welcome/index.erb
|
172
|
-
- lib/nyara/templates/config/database.yml
|
173
|
-
- lib/nyara/templates/
|
174
|
-
- lib/nyara/templates/
|
175
|
-
- lib/nyara/templates/
|
201
|
+
- lib/nyara/templates/config/database.yml.tt
|
202
|
+
- lib/nyara/templates/Gemfile.tt
|
203
|
+
- lib/nyara/templates/Linnerfile
|
204
|
+
- lib/nyara/templates/Rakefile
|
176
205
|
- bin/nyara
|
177
206
|
homepage: https://github.com/luikore/nyara
|
178
207
|
licenses:
|
@@ -195,6 +224,8 @@ rdoc_options:
|
|
195
224
|
- .*\.o
|
196
225
|
- -x
|
197
226
|
- .*\.bundle
|
227
|
+
- -x
|
228
|
+
- .*\.so
|
198
229
|
require_paths:
|
199
230
|
- lib
|
200
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -209,8 +240,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
240
|
version: 1.3.1
|
210
241
|
requirements: []
|
211
242
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.0.
|
243
|
+
rubygems_version: 2.1.0.rc.1
|
213
244
|
signing_key:
|
214
245
|
specification_version: 4
|
215
246
|
summary: Fast and fuzzy ruby web framework + server
|
216
247
|
test_files: []
|
248
|
+
has_rdoc:
|
data/ext/inc/status_codes.inc
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
#define HTTP_STATUS_CODES(XX)\
|
2
|
-
XX(100, "Continue");\
|
3
|
-
XX(101, "Switching Protocols");\
|
4
|
-
XX(102, "Processing");\
|
5
|
-
XX(200, "OK");\
|
6
|
-
XX(201, "Created");\
|
7
|
-
XX(202, "Accepted");\
|
8
|
-
XX(203, "Non-Authoritative Information");\
|
9
|
-
XX(204, "No Content");\
|
10
|
-
XX(205, "Reset Content");\
|
11
|
-
XX(206, "Partial Content");\
|
12
|
-
XX(207, "Multi-Status");\
|
13
|
-
XX(208, "Already Reported");\
|
14
|
-
XX(226, "IM Used");\
|
15
|
-
XX(300, "Multiple Choices");\
|
16
|
-
XX(301, "Moved Permanently");\
|
17
|
-
XX(302, "Found");\
|
18
|
-
XX(303, "See Other");\
|
19
|
-
XX(304, "Not Modified");\
|
20
|
-
XX(305, "Use Proxy");\
|
21
|
-
XX(306, "Reserved");\
|
22
|
-
XX(307, "Temporary Redirect");\
|
23
|
-
XX(308, "Permanent Redirect");\
|
24
|
-
XX(400, "Bad Request");\
|
25
|
-
XX(401, "Unauthorized");\
|
26
|
-
XX(402, "Payment Required");\
|
27
|
-
XX(403, "Forbidden");\
|
28
|
-
XX(404, "Not Found");\
|
29
|
-
XX(405, "Method Not Allowed");\
|
30
|
-
XX(406, "Not Acceptable");\
|
31
|
-
XX(407, "Proxy Authentication Required");\
|
32
|
-
XX(408, "Request Timeout");\
|
33
|
-
XX(409, "Conflict");\
|
34
|
-
XX(410, "Gone");\
|
35
|
-
XX(411, "Length Required");\
|
36
|
-
XX(412, "Precondition Failed");\
|
37
|
-
XX(413, "Request Entity Too Large");\
|
38
|
-
XX(414, "Request-URI Too Long");\
|
39
|
-
XX(415, "Unsupported Media Type");\
|
40
|
-
XX(416, "Requested Range Not Satisfiable");\
|
41
|
-
XX(417, "Expectation Failed");\
|
42
|
-
XX(422, "Unprocessable Entity");\
|
43
|
-
XX(423, "Locked");\
|
44
|
-
XX(424, "Failed Dependency");\
|
45
|
-
XX(425, "Unassigned");\
|
46
|
-
XX(426, "Upgrade Required");\
|
47
|
-
XX(427, "Unassigned");\
|
48
|
-
XX(428, "Precondition Required");\
|
49
|
-
XX(429, "Too Many Requests");\
|
50
|
-
XX(430, "Unassigned");\
|
51
|
-
XX(431, "Request Header Fields Too Large");\
|
52
|
-
XX(500, "Internal Server Error");\
|
53
|
-
XX(501, "Not Implemented");\
|
54
|
-
XX(502, "Bad Gateway");\
|
55
|
-
XX(503, "Service Unavailable");\
|
56
|
-
XX(504, "Gateway Timeout");\
|
57
|
-
XX(505, "HTTP Version Not Supported");\
|
58
|
-
XX(506, "Variant Also Negotiates (Experimental)");\
|
59
|
-
XX(507, "Insufficient Storage");\
|
60
|
-
XX(508, "Loop Detected");\
|
61
|
-
XX(509, "Unassigned");\
|
62
|
-
XX(510, "Not Extended");\
|
63
|
-
XX(511, "Network Authentication Required");\
|
64
|
-
// end define
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
5
|
-
<title><%= app_name %></title>
|
6
|
-
<link type="text/css" rel="stylesheet" href="/css/app.css">
|
7
|
-
<script type="text/javascript" src="/js/app.js"></script>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
<%%== yield %>
|
11
|
-
</body>
|
12
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
/* Put You css in here */
|
@@ -1 +0,0 @@
|
|
1
|
-
// Put you Javascript in here
|