roda 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +34 -0
- data/Rakefile +22 -46
- data/doc/release_notes/2.3.0.txt +109 -0
- data/lib/roda/plugins/assets.rb +2 -1
- data/lib/roda/plugins/caching.rb +1 -1
- data/lib/roda/plugins/chunked.rb +1 -1
- data/lib/roda/plugins/error_email.rb +1 -1
- data/lib/roda/plugins/head.rb +6 -0
- data/lib/roda/plugins/heartbeat.rb +40 -0
- data/lib/roda/plugins/json.rb +23 -3
- data/lib/roda/plugins/json_parser.rb +72 -0
- data/lib/roda/plugins/mailer.rb +22 -5
- data/lib/roda/plugins/named_templates.rb +2 -2
- data/lib/roda/plugins/path_rewriter.rb +82 -0
- data/lib/roda/plugins/precompile_templates.rb +87 -0
- data/lib/roda/plugins/render.rb +111 -43
- data/lib/roda/plugins/render_each.rb +1 -1
- data/lib/roda/plugins/shared_vars.rb +1 -1
- data/lib/roda/plugins/view_options.rb +28 -3
- data/lib/roda/version.rb +1 -1
- data/spec/composition_spec.rb +3 -3
- data/spec/env_spec.rb +1 -1
- data/spec/freeze_spec.rb +6 -6
- data/spec/integration_spec.rb +16 -15
- data/spec/matchers_spec.rb +110 -110
- data/spec/opts_spec.rb +8 -8
- data/spec/plugin/_erubis_escaping_spec.rb +34 -3
- data/spec/plugin/all_verbs_spec.rb +8 -8
- data/spec/plugin/assets_spec.rb +164 -150
- data/spec/plugin/backtracking_array_spec.rb +18 -18
- data/spec/plugin/caching_spec.rb +70 -70
- data/spec/plugin/chunked_spec.rb +38 -38
- data/spec/plugin/class_level_routing_spec.rb +78 -78
- data/spec/plugin/content_for_spec.rb +2 -2
- data/spec/plugin/cookies_spec.rb +4 -4
- data/spec/plugin/csrf_spec.rb +8 -8
- data/spec/plugin/default_headers_spec.rb +6 -6
- data/spec/plugin/delay_build_spec.rb +7 -6
- data/spec/plugin/delegate_spec.rb +2 -2
- data/spec/plugin/delete_empty_headers_spec.rb +2 -2
- data/spec/plugin/drop_body_spec.rb +6 -6
- data/spec/plugin/empty_root_spec.rb +3 -3
- data/spec/plugin/environments_spec.rb +7 -7
- data/spec/plugin/error_email_spec.rb +23 -23
- data/spec/plugin/error_handler_spec.rb +14 -14
- data/spec/plugin/flash_spec.rb +30 -29
- data/spec/plugin/h_spec.rb +1 -1
- data/spec/plugin/halt_spec.rb +16 -16
- data/spec/plugin/hash_matcher_spec.rb +5 -5
- data/spec/plugin/head_spec.rb +10 -10
- data/spec/plugin/header_matchers_spec.rb +13 -13
- data/spec/plugin/heartbeat_spec.rb +74 -0
- data/spec/plugin/hooks_spec.rb +20 -20
- data/spec/plugin/indifferent_params_spec.rb +1 -1
- data/spec/plugin/json_parser_spec.rb +72 -0
- data/spec/plugin/json_spec.rb +22 -9
- data/spec/plugin/mailer_spec.rb +72 -58
- data/spec/plugin/match_affix_spec.rb +2 -2
- data/spec/plugin/middleware_spec.rb +7 -7
- data/spec/plugin/module_include_spec.rb +4 -4
- data/spec/plugin/multi_route_spec.rb +66 -66
- data/spec/plugin/multi_run_spec.rb +21 -21
- data/spec/plugin/named_templates_spec.rb +6 -6
- data/spec/plugin/not_allowed_spec.rb +17 -17
- data/spec/plugin/not_found_spec.rb +14 -14
- data/spec/plugin/padrino_render_spec.rb +2 -2
- data/spec/plugin/param_matchers_spec.rb +6 -6
- data/spec/plugin/partials_spec.rb +3 -3
- data/spec/plugin/pass_spec.rb +7 -7
- data/spec/plugin/path_matchers_spec.rb +6 -6
- data/spec/plugin/path_rewriter_spec.rb +37 -0
- data/spec/plugin/path_spec.rb +41 -40
- data/spec/plugin/per_thread_caching_spec.rb +6 -6
- data/spec/plugin/precompile_templates_spec.rb +74 -0
- data/spec/plugin/render_each_spec.rb +4 -4
- data/spec/plugin/render_spec.rb +179 -76
- data/spec/plugin/shared_vars_spec.rb +4 -4
- data/spec/plugin/sinatra_helpers_spec.rb +121 -121
- data/spec/plugin/slash_path_empty_spec.rb +10 -10
- data/spec/plugin/static_spec.rb +4 -4
- data/spec/plugin/streaming_spec.rb +11 -11
- data/spec/plugin/symbol_matchers_spec.rb +24 -24
- data/spec/plugin/symbol_views_spec.rb +3 -3
- data/spec/plugin/view_options_spec.rb +10 -10
- data/spec/plugin_spec.rb +2 -2
- data/spec/redirect_spec.rb +10 -10
- data/spec/request_spec.rb +8 -8
- data/spec/response_spec.rb +23 -23
- data/spec/session_spec.rb +4 -4
- data/spec/spec_helper.rb +5 -19
- data/spec/version_spec.rb +4 -4
- data/spec/views/iv.erb +1 -0
- metadata +16 -5
data/spec/session_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe "session handling" do
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
body.
|
13
|
+
body.must_match(/use Rack::Session::Cookie/)
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return session if available" do
|
@@ -26,10 +26,10 @@ describe "session handling" do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
_, h, b = req
|
29
|
-
b.join.
|
29
|
+
b.join.must_equal 'ab'
|
30
30
|
_, h, b = req('HTTP_COOKIE'=>h['Set-Cookie'].sub("; path=/; HttpOnly", ''))
|
31
|
-
b.join.
|
31
|
+
b.join.must_equal 'abb'
|
32
32
|
_, h, b = req('HTTP_COOKIE'=>h['Set-Cookie'].sub("; path=/; HttpOnly", ''))
|
33
|
-
b.join.
|
33
|
+
b.join.must_equal 'abbb'
|
34
34
|
end
|
35
35
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -21,29 +21,15 @@ end
|
|
21
21
|
|
22
22
|
require "roda"
|
23
23
|
require "stringio"
|
24
|
+
gem 'minitest'
|
25
|
+
require "minitest/autorun"
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
require 'rspec/version'
|
28
|
-
if RSpec::Version::STRING >= '2.11.0'
|
29
|
-
RSpec.configure do |config|
|
30
|
-
config.expect_with :rspec do |c|
|
31
|
-
c.syntax = :should
|
32
|
-
end
|
33
|
-
config.mock_with :rspec do |c|
|
34
|
-
c.syntax = :should
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
RSPEC_EXAMPLE_GROUP = RSpec::Core::ExampleGroup
|
39
|
-
else
|
40
|
-
RSPEC_EXAMPLE_GROUP = Spec::Example::ExampleGroup
|
41
|
-
end
|
42
|
-
end
|
27
|
+
# Work around minitest issue requiring specific exception class
|
28
|
+
FrozenError = RUBY_VERSION >= '1.9' ? RuntimeError : TypeError
|
43
29
|
|
44
30
|
#def (Roda::RodaPlugins).warn(s); end
|
45
31
|
|
46
|
-
class
|
32
|
+
class Minitest::Spec
|
47
33
|
def app(type=nil, &block)
|
48
34
|
case type
|
49
35
|
when :new
|
data/spec/version_spec.rb
CHANGED
@@ -2,13 +2,13 @@ require File.expand_path("spec_helper", File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
describe "Roda version constants" do
|
4
4
|
it "RodaVersion should be a string in x.y.z integer format" do
|
5
|
-
Roda::RodaVersion.
|
5
|
+
Roda::RodaVersion.must_match(/\A\d+\.\d+\.\d+\z/)
|
6
6
|
end
|
7
7
|
|
8
8
|
it "Roda*Version should be integers" do
|
9
|
-
Roda::RodaMajorVersion.
|
10
|
-
Roda::RodaMinorVersion.
|
11
|
-
Roda::RodaPatchVersion.
|
9
|
+
Roda::RodaMajorVersion.must_be_kind_of(Integer)
|
10
|
+
Roda::RodaMinorVersion.must_be_kind_of(Integer)
|
11
|
+
Roda::RodaPatchVersion.must_be_kind_of(Integer)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
data/spec/views/iv.erb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<%= @a %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.6.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.6.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tilt
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,6 +139,7 @@ extra_rdoc_files:
|
|
139
139
|
- doc/release_notes/2.0.0.txt
|
140
140
|
- doc/release_notes/2.1.0.txt
|
141
141
|
- doc/release_notes/2.2.0.txt
|
142
|
+
- doc/release_notes/2.3.0.txt
|
142
143
|
files:
|
143
144
|
- CHANGELOG
|
144
145
|
- MIT-LICENSE
|
@@ -152,6 +153,7 @@ files:
|
|
152
153
|
- doc/release_notes/2.0.0.txt
|
153
154
|
- doc/release_notes/2.1.0.txt
|
154
155
|
- doc/release_notes/2.2.0.txt
|
156
|
+
- doc/release_notes/2.3.0.txt
|
155
157
|
- lib/roda.rb
|
156
158
|
- lib/roda/plugins/_erubis_escaping.rb
|
157
159
|
- lib/roda/plugins/all_verbs.rb
|
@@ -178,9 +180,11 @@ files:
|
|
178
180
|
- lib/roda/plugins/hash_matcher.rb
|
179
181
|
- lib/roda/plugins/head.rb
|
180
182
|
- lib/roda/plugins/header_matchers.rb
|
183
|
+
- lib/roda/plugins/heartbeat.rb
|
181
184
|
- lib/roda/plugins/hooks.rb
|
182
185
|
- lib/roda/plugins/indifferent_params.rb
|
183
186
|
- lib/roda/plugins/json.rb
|
187
|
+
- lib/roda/plugins/json_parser.rb
|
184
188
|
- lib/roda/plugins/mailer.rb
|
185
189
|
- lib/roda/plugins/match_affix.rb
|
186
190
|
- lib/roda/plugins/middleware.rb
|
@@ -196,7 +200,9 @@ files:
|
|
196
200
|
- lib/roda/plugins/pass.rb
|
197
201
|
- lib/roda/plugins/path.rb
|
198
202
|
- lib/roda/plugins/path_matchers.rb
|
203
|
+
- lib/roda/plugins/path_rewriter.rb
|
199
204
|
- lib/roda/plugins/per_thread_caching.rb
|
205
|
+
- lib/roda/plugins/precompile_templates.rb
|
200
206
|
- lib/roda/plugins/render.rb
|
201
207
|
- lib/roda/plugins/render_each.rb
|
202
208
|
- lib/roda/plugins/shared_vars.rb
|
@@ -245,8 +251,10 @@ files:
|
|
245
251
|
- spec/plugin/hash_matcher_spec.rb
|
246
252
|
- spec/plugin/head_spec.rb
|
247
253
|
- spec/plugin/header_matchers_spec.rb
|
254
|
+
- spec/plugin/heartbeat_spec.rb
|
248
255
|
- spec/plugin/hooks_spec.rb
|
249
256
|
- spec/plugin/indifferent_params_spec.rb
|
257
|
+
- spec/plugin/json_parser_spec.rb
|
250
258
|
- spec/plugin/json_spec.rb
|
251
259
|
- spec/plugin/mailer_spec.rb
|
252
260
|
- spec/plugin/match_affix_spec.rb
|
@@ -262,8 +270,10 @@ files:
|
|
262
270
|
- spec/plugin/partials_spec.rb
|
263
271
|
- spec/plugin/pass_spec.rb
|
264
272
|
- spec/plugin/path_matchers_spec.rb
|
273
|
+
- spec/plugin/path_rewriter_spec.rb
|
265
274
|
- spec/plugin/path_spec.rb
|
266
275
|
- spec/plugin/per_thread_caching_spec.rb
|
276
|
+
- spec/plugin/precompile_templates_spec.rb
|
267
277
|
- spec/plugin/render_each_spec.rb
|
268
278
|
- spec/plugin/render_spec.rb
|
269
279
|
- spec/plugin/shared_vars_spec.rb
|
@@ -287,6 +297,7 @@ files:
|
|
287
297
|
- spec/views/content-yield.erb
|
288
298
|
- spec/views/home.erb
|
289
299
|
- spec/views/home.str
|
300
|
+
- spec/views/iv.erb
|
290
301
|
- spec/views/layout-alternative.erb
|
291
302
|
- spec/views/layout-yield.erb
|
292
303
|
- spec/views/layout.erb
|