roda 3.28.0 → 3.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +10 -0
- data/README.rdoc +10 -0
- data/doc/release_notes/3.29.0.txt +15 -0
- data/lib/roda.rb +1 -0
- data/lib/roda/plugins/caching.rb +2 -0
- data/lib/roda/plugins/common_logger.rb +1 -1
- data/lib/roda/plugins/exception_page.rb +7 -1
- data/lib/roda/plugins/indifferent_params.rb +2 -0
- data/lib/roda/version.rb +1 -1
- metadata +4 -214
- data/Rakefile +0 -108
- data/doc/release_notes/1.0.0.txt +0 -329
- data/doc/release_notes/1.1.0.txt +0 -226
- data/doc/release_notes/1.2.0.txt +0 -406
- data/doc/release_notes/1.3.0.txt +0 -109
- data/doc/release_notes/2.0.0.txt +0 -75
- data/doc/release_notes/2.1.0.txt +0 -124
- data/doc/release_notes/2.10.0.txt +0 -27
- data/doc/release_notes/2.11.0.txt +0 -70
- data/doc/release_notes/2.12.0.txt +0 -40
- data/doc/release_notes/2.13.0.txt +0 -10
- data/doc/release_notes/2.14.0.txt +0 -44
- data/doc/release_notes/2.15.0.txt +0 -53
- data/doc/release_notes/2.16.0.txt +0 -48
- data/doc/release_notes/2.17.0.txt +0 -62
- data/doc/release_notes/2.18.0.txt +0 -69
- data/doc/release_notes/2.19.0.txt +0 -30
- data/doc/release_notes/2.2.0.txt +0 -97
- data/doc/release_notes/2.20.0.txt +0 -5
- data/doc/release_notes/2.21.0.txt +0 -17
- data/doc/release_notes/2.22.0.txt +0 -41
- data/doc/release_notes/2.23.0.txt +0 -29
- data/doc/release_notes/2.24.0.txt +0 -65
- data/doc/release_notes/2.25.0.txt +0 -14
- data/doc/release_notes/2.26.0.txt +0 -13
- data/doc/release_notes/2.27.0.txt +0 -56
- data/doc/release_notes/2.28.0.txt +0 -17
- data/doc/release_notes/2.29.0.txt +0 -156
- data/doc/release_notes/2.3.0.txt +0 -109
- data/doc/release_notes/2.4.0.txt +0 -55
- data/doc/release_notes/2.5.0.txt +0 -23
- data/doc/release_notes/2.5.1.txt +0 -4
- data/doc/release_notes/2.6.0.txt +0 -21
- data/doc/release_notes/2.7.0.txt +0 -75
- data/doc/release_notes/2.8.0.txt +0 -44
- data/doc/release_notes/2.9.0.txt +0 -6
- data/spec/all.rb +0 -1
- data/spec/assets/css/app.scss +0 -1
- data/spec/assets/css/no_access.css +0 -1
- data/spec/assets/css/raw.css +0 -1
- data/spec/assets/js/head/app.js +0 -1
- data/spec/composition_spec.rb +0 -31
- data/spec/define_roda_method_spec.rb +0 -274
- data/spec/env_spec.rb +0 -11
- data/spec/freeze_spec.rb +0 -37
- data/spec/integration_spec.rb +0 -209
- data/spec/matchers_spec.rb +0 -832
- data/spec/opts_spec.rb +0 -42
- data/spec/plugin/_after_hook_spec.rb +0 -19
- data/spec/plugin/all_verbs_spec.rb +0 -29
- data/spec/plugin/assets_preloading_spec.rb +0 -98
- data/spec/plugin/assets_spec.rb +0 -745
- data/spec/plugin/backtracking_array_spec.rb +0 -42
- data/spec/plugin/branch_locals_spec.rb +0 -106
- data/spec/plugin/caching_spec.rb +0 -337
- data/spec/plugin/chunked_spec.rb +0 -201
- data/spec/plugin/class_level_routing_spec.rb +0 -164
- data/spec/plugin/class_matchers_spec.rb +0 -40
- data/spec/plugin/common_logger_spec.rb +0 -85
- data/spec/plugin/content_for_spec.rb +0 -162
- data/spec/plugin/content_security_policy_spec.rb +0 -175
- data/spec/plugin/cookies_spec.rb +0 -51
- data/spec/plugin/csrf_spec.rb +0 -111
- data/spec/plugin/default_headers_spec.rb +0 -82
- data/spec/plugin/default_status_spec.rb +0 -95
- data/spec/plugin/delay_build_spec.rb +0 -23
- data/spec/plugin/delegate_spec.rb +0 -23
- data/spec/plugin/delete_empty_headers_spec.rb +0 -27
- data/spec/plugin/direct_call_spec.rb +0 -28
- data/spec/plugin/disallow_file_uploads_spec.rb +0 -25
- data/spec/plugin/drop_body_spec.rb +0 -24
- data/spec/plugin/early_hints_spec.rb +0 -19
- data/spec/plugin/empty_root_spec.rb +0 -14
- data/spec/plugin/environments_spec.rb +0 -42
- data/spec/plugin/error_email_spec.rb +0 -97
- data/spec/plugin/error_handler_spec.rb +0 -216
- data/spec/plugin/error_mail_spec.rb +0 -93
- data/spec/plugin/exception_page_spec.rb +0 -168
- data/spec/plugin/flash_spec.rb +0 -121
- data/spec/plugin/h_spec.rb +0 -11
- data/spec/plugin/halt_spec.rb +0 -119
- data/spec/plugin/hash_matcher_spec.rb +0 -27
- data/spec/plugin/hash_routes_spec.rb +0 -535
- data/spec/plugin/head_spec.rb +0 -52
- data/spec/plugin/header_matchers_spec.rb +0 -98
- data/spec/plugin/heartbeat_spec.rb +0 -74
- data/spec/plugin/hooks_spec.rb +0 -152
- data/spec/plugin/indifferent_params_spec.rb +0 -14
- data/spec/plugin/json_parser_spec.rb +0 -141
- data/spec/plugin/json_spec.rb +0 -83
- data/spec/plugin/mail_processor_spec.rb +0 -451
- data/spec/plugin/mailer_spec.rb +0 -282
- data/spec/plugin/match_affix_spec.rb +0 -43
- data/spec/plugin/match_hook_spec.rb +0 -79
- data/spec/plugin/middleware_spec.rb +0 -237
- data/spec/plugin/middleware_stack_spec.rb +0 -81
- data/spec/plugin/module_include_spec.rb +0 -48
- data/spec/plugin/multi_route_spec.rb +0 -268
- data/spec/plugin/multi_run_spec.rb +0 -87
- data/spec/plugin/multi_view_spec.rb +0 -50
- data/spec/plugin/multibyte_string_matcher_spec.rb +0 -44
- data/spec/plugin/named_templates_spec.rb +0 -96
- data/spec/plugin/not_allowed_spec.rb +0 -69
- data/spec/plugin/not_found_spec.rb +0 -128
- data/spec/plugin/optimized_string_matchers_spec.rb +0 -43
- data/spec/plugin/padrino_render_spec.rb +0 -34
- data/spec/plugin/param_matchers_spec.rb +0 -69
- data/spec/plugin/params_capturing_spec.rb +0 -33
- data/spec/plugin/partials_spec.rb +0 -43
- data/spec/plugin/pass_spec.rb +0 -29
- data/spec/plugin/path_matchers_spec.rb +0 -42
- data/spec/plugin/path_rewriter_spec.rb +0 -45
- data/spec/plugin/path_spec.rb +0 -222
- data/spec/plugin/placeholder_string_matchers_spec.rb +0 -126
- data/spec/plugin/precompile_templates_spec.rb +0 -61
- data/spec/plugin/public_spec.rb +0 -85
- data/spec/plugin/render_each_spec.rb +0 -82
- data/spec/plugin/render_locals_spec.rb +0 -114
- data/spec/plugin/render_spec.rb +0 -912
- data/spec/plugin/request_aref_spec.rb +0 -51
- data/spec/plugin/request_headers_spec.rb +0 -39
- data/spec/plugin/response_request_spec.rb +0 -43
- data/spec/plugin/route_block_args_spec.rb +0 -86
- data/spec/plugin/route_csrf_spec.rb +0 -305
- data/spec/plugin/run_append_slash_spec.rb +0 -77
- data/spec/plugin/run_handler_spec.rb +0 -53
- data/spec/plugin/sessions_spec.rb +0 -452
- data/spec/plugin/shared_vars_spec.rb +0 -45
- data/spec/plugin/sinatra_helpers_spec.rb +0 -537
- data/spec/plugin/slash_path_empty_spec.rb +0 -22
- data/spec/plugin/static_routing_spec.rb +0 -192
- data/spec/plugin/static_spec.rb +0 -30
- data/spec/plugin/status_303_spec.rb +0 -28
- data/spec/plugin/status_handler_spec.rb +0 -158
- data/spec/plugin/streaming_spec.rb +0 -246
- data/spec/plugin/strip_path_prefix_spec.rb +0 -24
- data/spec/plugin/symbol_matchers_spec.rb +0 -51
- data/spec/plugin/symbol_status_spec.rb +0 -25
- data/spec/plugin/symbol_views_spec.rb +0 -32
- data/spec/plugin/timestamp_public_spec.rb +0 -85
- data/spec/plugin/type_routing_spec.rb +0 -348
- data/spec/plugin/typecast_params_spec.rb +0 -1370
- data/spec/plugin/unescape_path_spec.rb +0 -22
- data/spec/plugin/view_options_spec.rb +0 -170
- data/spec/plugin_spec.rb +0 -71
- data/spec/redirect_spec.rb +0 -41
- data/spec/request_spec.rb +0 -97
- data/spec/response_spec.rb +0 -199
- data/spec/route_spec.rb +0 -39
- data/spec/session_middleware_spec.rb +0 -129
- data/spec/session_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -137
- data/spec/version_spec.rb +0 -14
- data/spec/views/_test.erb +0 -1
- data/spec/views/a.erb +0 -1
- data/spec/views/a.rdoc +0 -2
- data/spec/views/about.erb +0 -1
- data/spec/views/about.str +0 -1
- data/spec/views/about/_test.css.gz +0 -0
- data/spec/views/about/_test.erb +0 -1
- data/spec/views/about/_test.erb.gz +0 -0
- data/spec/views/about/comp_test.erb +0 -1
- data/spec/views/b.erb +0 -1
- data/spec/views/c.erb +0 -1
- data/spec/views/comp_layout.erb +0 -1
- data/spec/views/comp_test.erb +0 -1
- data/spec/views/content-yield.erb +0 -1
- data/spec/views/each.str +0 -1
- data/spec/views/home.erb +0 -2
- data/spec/views/home.str +0 -2
- data/spec/views/iv.erb +0 -1
- data/spec/views/layout-alternative.erb +0 -2
- data/spec/views/layout-yield.erb +0 -3
- data/spec/views/layout.erb +0 -2
- data/spec/views/layout.str +0 -2
- data/spec/views/multiple-layout.erb +0 -1
- data/spec/views/multiple.erb +0 -1
data/doc/release_notes/2.0.0.txt
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
= Backwards Compatibility
|
2
|
-
|
3
|
-
* RodaResponse#set_cookie and #delete_cookie have been removed.
|
4
|
-
|
5
|
-
* Roda.request_module and .response_module have been removed.
|
6
|
-
|
7
|
-
* Roda.hash_matcher has been removed.
|
8
|
-
|
9
|
-
* The :extension hash matcher has been removed.
|
10
|
-
|
11
|
-
* The :param and :param! hash matchers have been removed.
|
12
|
-
|
13
|
-
* RodaRequest#full_path_info has been removed.
|
14
|
-
|
15
|
-
* The :opts render plugin option is no longer respected, Use the
|
16
|
-
:template_opts option instead.
|
17
|
-
|
18
|
-
* Plugin option hashes for the chunked, default_headers,
|
19
|
-
error_email, and render plugins are now frozen.
|
20
|
-
|
21
|
-
* The :header hash matcher in the header_matchers plugin now
|
22
|
-
yields the header value to the block.
|
23
|
-
|
24
|
-
* Roda.json_result_classes in the json plugin is now frozen.
|
25
|
-
|
26
|
-
* The PATH_INFO and SCRIPT_NAME env variables are no longer modified
|
27
|
-
during routing.
|
28
|
-
|
29
|
-
* Roda#initialize now takes an env hash, and #call now takes the
|
30
|
-
route block. The private #_route method has been removed.
|
31
|
-
|
32
|
-
* RodaRequest#keep_remaining_path/#updating_remaining_path private
|
33
|
-
methods have been removed.
|
34
|
-
|
35
|
-
* The render plugin's :layout option is now always set to true or
|
36
|
-
false, specifying whether a layout should be used by default.
|
37
|
-
The template used for a layout is now located as the :template
|
38
|
-
option inside :layout_opts.
|
39
|
-
|
40
|
-
= New Plugins
|
41
|
-
|
42
|
-
* A padrino_render plugin has been added, which adds render/partial
|
43
|
-
methods that work similarly to Padrino's.
|
44
|
-
|
45
|
-
= Other New Features
|
46
|
-
|
47
|
-
* A Roda#render_template private method has been added to the render
|
48
|
-
plugin. All internal users of render should switch to calling
|
49
|
-
render_template.
|
50
|
-
|
51
|
-
* The halt plugin now integrates with the symbol_views and json
|
52
|
-
plugins, allowing things like:
|
53
|
-
|
54
|
-
r.halt(:template)
|
55
|
-
r.halt('key'=>'value')
|
56
|
-
|
57
|
-
= Other Improvements
|
58
|
-
|
59
|
-
* The error_handler plugin now rescues ScriptError in addition to
|
60
|
-
StandardError. This handles SyntaxError (raised by ERB),
|
61
|
-
LoadError (raised by require), and NotImplementedError (raised
|
62
|
-
by TSort).
|
63
|
-
|
64
|
-
* Using a :layout=>true option to the render plugin's view method
|
65
|
-
now uses the default layout template, instead of a template named
|
66
|
-
'true'. It can be used to force a layout even if the render
|
67
|
-
plugin has been configured to not use a layout by default.
|
68
|
-
|
69
|
-
* Roda apps that use the middleware plugin can now be used as regular
|
70
|
-
rack apps. Previously, using the middleware plugin made it
|
71
|
-
impossible to use the app as a regular rack app.
|
72
|
-
|
73
|
-
* Roda#request and #response are now faster.
|
74
|
-
|
75
|
-
* Roda avoids creating unnecessary hashes in more places now.
|
data/doc/release_notes/2.1.0.txt
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
= New Plugins
|
2
|
-
|
3
|
-
* A view_options plugin has been added, for branch/route specific
|
4
|
-
setting of view and layout options and locals. This allows for
|
5
|
-
DRYer code when you want to change the view or layout settings
|
6
|
-
for an entire routing branch. Options and locals set at the
|
7
|
-
branch or route level have higher priority than those set at
|
8
|
-
the plugin level, but lower priority than those provided as
|
9
|
-
arguments to the render/view methods. Example:
|
10
|
-
|
11
|
-
class App < Roda
|
12
|
-
plugin :view_options
|
13
|
-
|
14
|
-
route do |r|
|
15
|
-
r.on 'albums' do
|
16
|
-
layout_options :template=>'layouts/3_columns'
|
17
|
-
layout_locals :heading=>'Albums'
|
18
|
-
view_options :ext=>'haml'
|
19
|
-
view_locals :name=>'Foo'
|
20
|
-
# ...
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
The view_options plugin is also a superset of the previous
|
26
|
-
view_subdirs plugin, and attempts to load view_subdirs will
|
27
|
-
now load view_options. In addition to set_view_subdir, the
|
28
|
-
view_options plugin now supports append_view_subdir, which
|
29
|
-
will append a subdirectory to an existing subdirectory, which
|
30
|
-
makes it simpler to deal with nested view file hierarchies.
|
31
|
-
|
32
|
-
* A static plugin has been added for easily serving static files
|
33
|
-
using Rack::Static. Example:
|
34
|
-
|
35
|
-
class App < Roda
|
36
|
-
plugin :static, ['/js', '/css']
|
37
|
-
# or:
|
38
|
-
plugin :static, ['/js', '/css'], :root=>'pub'
|
39
|
-
end
|
40
|
-
|
41
|
-
= Other New Features
|
42
|
-
|
43
|
-
* Roda now supports a :root option for the application that sets
|
44
|
-
the root directory. This is useful if the application's files
|
45
|
-
are not stored in the process's working directory, which is
|
46
|
-
common for processes containing of multiple Roda applications.
|
47
|
-
|
48
|
-
By setting the :root option, plugins that use the file system
|
49
|
-
will default to making relative paths relative to the :root
|
50
|
-
option instead of the process's working directory. The
|
51
|
-
assets, render, and static plugins currently support the :root
|
52
|
-
option. Example:
|
53
|
-
|
54
|
-
class App < Roda
|
55
|
-
opts[:root] = File.dirname(__FILE__)
|
56
|
-
end
|
57
|
-
|
58
|
-
* Roda now supports an :add_script_name option for the application,
|
59
|
-
which makes plugins automatically prepend the SCRIPT_NAME for the
|
60
|
-
request's environment to any paths created. This allows Roda
|
61
|
-
applications to work transparently whenever they are mounted
|
62
|
-
inside of another rack application.
|
63
|
-
|
64
|
-
The assets and path plugins currently recognize the
|
65
|
-
:add_script_name option. Example:
|
66
|
-
|
67
|
-
class App < Roda
|
68
|
-
opts[:add_script_name] = true
|
69
|
-
end
|
70
|
-
|
71
|
-
* The path plugin now adds a Roda#path method, which creates paths
|
72
|
-
based on the type of argument used. You can register classes
|
73
|
-
with the path plugin by providing Roda.path with a class, which
|
74
|
-
will cause Roda#path to recognize them and handle them accordingly.
|
75
|
-
|
76
|
-
Example:
|
77
|
-
|
78
|
-
class App < Roda
|
79
|
-
plugin :path
|
80
|
-
path(Track){|track| "/albums/#{track.album_id}/tracks/#{track.number}"}
|
81
|
-
|
82
|
-
route do
|
83
|
-
r.get 'tracks/:id' do |track_id|
|
84
|
-
r.redirect(path(Track[track_id]))
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
= Other Improvements
|
90
|
-
|
91
|
-
* add_file in the mailer plugin now adds the files after the email
|
92
|
-
body instead of before. This fixes some issues where the email
|
93
|
-
body would end up empty, due to issues with the mail gem's API.
|
94
|
-
|
95
|
-
add_file now accepts a block, and the block is called after the
|
96
|
-
file has been attached. Among other things, this allows you to
|
97
|
-
change the content_type for an attached file:
|
98
|
-
|
99
|
-
add_file 'path/to/file' do
|
100
|
-
response.mail.attachments.last.content_type = 'text/foo'
|
101
|
-
end
|
102
|
-
|
103
|
-
* r.multi_route in the multi_route plugin now works if there are
|
104
|
-
no named routes defined.
|
105
|
-
|
106
|
-
* A render plugin :locals option is now respected, setting defaults
|
107
|
-
to use for locals in views. Additionally, a :locals option in
|
108
|
-
the :layout_opts option is now respected for setting locals in
|
109
|
-
layouts. If both the render plugin option is set and :locals is
|
110
|
-
passed to render/view, the two will be merged together.
|
111
|
-
Previously, providing a :locals option to render/view would cause
|
112
|
-
the plugin level option to be ignored.
|
113
|
-
|
114
|
-
= Backwards Compatibility
|
115
|
-
|
116
|
-
* Using the render plugin :layout=>nil option now removes any
|
117
|
-
layout template set previously using :layout. Previously, the
|
118
|
-
layout template would still be kept, but it would not be used
|
119
|
-
by default.
|
120
|
-
|
121
|
-
* Accessing attachments after adding a file using add_file in the
|
122
|
-
mailer plugin no longer works, as the adding is now delayed until
|
123
|
-
after the body is set. You should now pass a block to add_file
|
124
|
-
if you want to access the attachment after it has been added.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* The json plugin now accepts a :content_type option, which will
|
4
|
-
override the default Content-Type response header used for
|
5
|
-
responses.
|
6
|
-
|
7
|
-
* Stream#write has been added to the streaming plugin, allowing
|
8
|
-
the following type of code to work:
|
9
|
-
|
10
|
-
stream do |out|
|
11
|
-
IO.copy_stream(StringIO.new(content), out)
|
12
|
-
end
|
13
|
-
|
14
|
-
= Other Improvements
|
15
|
-
|
16
|
-
* Roda now works with ruby 2.3's --enable-frozen-string-literal,
|
17
|
-
and all of the library files are set to use frozen string
|
18
|
-
literals by default.
|
19
|
-
|
20
|
-
Most of roda's plugin-specific dependencies were found to have
|
21
|
-
issues with frozen string literals, and while pull requests have
|
22
|
-
been sent to fix the issues, it's unlikely that you would
|
23
|
-
currently be able to use --enable-frozen-string-literal in
|
24
|
-
production.
|
25
|
-
|
26
|
-
* The json plugin will no longer override a Content-Type header if
|
27
|
-
one is already set.
|
@@ -1,70 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* A params_capturing plugin has been added, which makes string and
|
4
|
-
symbol matchers update the request params with the value of the
|
5
|
-
captured segments, using the matcher as the key:
|
6
|
-
|
7
|
-
plugin :params_capturing
|
8
|
-
|
9
|
-
route do |r|
|
10
|
-
# GET /foo/123/abc/67
|
11
|
-
r.on("foo/:bar/:baz", :quux) do
|
12
|
-
r[:bar] #=> '123'
|
13
|
-
r[:baz] #=> 'abc'
|
14
|
-
r[:quux] #=> '67'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
Note that this updating of the request params using the matcher as
|
19
|
-
the key is only done if all arguments to the matcher are symbols
|
20
|
-
or strings.
|
21
|
-
|
22
|
-
All matchers will update the request params by adding all
|
23
|
-
captured segments to the captures key, including
|
24
|
-
symbol and string matchers:
|
25
|
-
|
26
|
-
r.on(:x, /(\d+)\/(\w+)/, ':y') do
|
27
|
-
r[:x] #=> nil
|
28
|
-
r[:y] #=> nil
|
29
|
-
r[:captures] #=> ["foo", "123", "abc", "67"]
|
30
|
-
end
|
31
|
-
|
32
|
-
Note that the request params captures entry will be appended to with
|
33
|
-
each nested match:
|
34
|
-
|
35
|
-
r.on(:w) do
|
36
|
-
r.on(:x) do
|
37
|
-
r.on(:y) do
|
38
|
-
r.on(:z) do
|
39
|
-
r[:captures] # => ["foo", "123", "abc", "67"]
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
Note that any existing params captures entry will be overwritten
|
46
|
-
by this plugin. You can use r.GET or r.POST to get the underlying
|
47
|
-
entry, depending on how it was submitted.
|
48
|
-
|
49
|
-
Also note that the param keys are actually stored in r.params as
|
50
|
-
strings and not symbols (r[] converts the argument to a string
|
51
|
-
before looking it up in r.params).
|
52
|
-
|
53
|
-
Also note that this plugin will not work correctly if you are using
|
54
|
-
the symbol_matchers plugin with custom symbol matching and are using
|
55
|
-
symbols that capture multiple values or no values.
|
56
|
-
|
57
|
-
* A :scope option is now supported by render/view in the render plugin,
|
58
|
-
which allows you to specify the object in which context to evaluate
|
59
|
-
the template.
|
60
|
-
|
61
|
-
= Other Improvements
|
62
|
-
|
63
|
-
* The assets plugin's support for the Minjs javascript minifier now
|
64
|
-
supports the latest version (0.4.1).
|
65
|
-
|
66
|
-
= Backwards Compatibility
|
67
|
-
|
68
|
-
* Support for Minjs <0.4.0 has been dropped from the assets plugin.
|
69
|
-
Please upgrade Minjs at the same time you upgrade Roda if you are
|
70
|
-
using both of them.
|
@@ -1,40 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* An optimized_string_matchers plugin has been added, which contains
|
4
|
-
optimized matchers for single strings. r.on_branch is an optimized
|
5
|
-
version of r.on and r.is_exactly is optimized version of r.is:
|
6
|
-
|
7
|
-
plugin :optimized_string_matchers
|
8
|
-
|
9
|
-
route do |r|
|
10
|
-
r.on_branch "x" do
|
11
|
-
# matches /x and paths starting with /x/
|
12
|
-
r.is_exactly "y" do
|
13
|
-
# matches /x/y
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
Both of these methods will work even if the strings have placeholders,
|
19
|
-
but no captures will be yielded to the blocks.
|
20
|
-
|
21
|
-
* The error_handler plugin now has access to the request's
|
22
|
-
remaining_path when handling an error. You can then compare the
|
23
|
-
remaining_path to path_info to see how much of request was already
|
24
|
-
routed, which can be useful when reporting errors.
|
25
|
-
|
26
|
-
= Other Improvements
|
27
|
-
|
28
|
-
* String matching for strings without placeholders is now 60% faster
|
29
|
-
as it uses optimized string operations instead of a regexp match.
|
30
|
-
|
31
|
-
* Symbol matching is now 60% faster as it uses optimized string
|
32
|
-
operations instead of a regexp match.
|
33
|
-
|
34
|
-
= Backwards Compatibility
|
35
|
-
|
36
|
-
* The match methods no longer automatically reset the remaining_path
|
37
|
-
via ensure. This means that using non-local jumps out of the code
|
38
|
-
such as begin/rescue and throw/catch will not reset remaining_path
|
39
|
-
automatically. Users that want to reset remaining path in
|
40
|
-
such cases should use their own ensure blocks.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* The render plugin now supports :check_paths and :allowed_paths
|
4
|
-
options. Setting :check_paths to true will turn on path checking of
|
5
|
-
template files. By default, template files are required to be in
|
6
|
-
the :views directory, otherwise an exception will be raised. Using
|
7
|
-
the :check_paths option can prevent security issues when template
|
8
|
-
names are derived from user input. The :allowed_paths option
|
9
|
-
overrides which path prefixes are allowed. In Roda 3, :check_paths
|
10
|
-
will default to true.
|
@@ -1,44 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* A symbol_status plugin has been added for using symbolic status names
|
4
|
-
in response.status=:
|
5
|
-
|
6
|
-
class App < Roda
|
7
|
-
plugin :symbol_status
|
8
|
-
|
9
|
-
route do |r|
|
10
|
-
r.is "needs_authorization"
|
11
|
-
response.status = :unauthorized
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
= Other Improvements
|
16
|
-
|
17
|
-
* The middleware plugin will now also run the application's middleware
|
18
|
-
when the application is used as middleware. For example, if you
|
19
|
-
have the following code in your config.ru file:
|
20
|
-
|
21
|
-
class App < Roda
|
22
|
-
plugin :csrf
|
23
|
-
plugin :middleware
|
24
|
-
route{}
|
25
|
-
end
|
26
|
-
|
27
|
-
use App
|
28
|
-
|
29
|
-
previously, the csrf protection would not be enforced, as it uses a
|
30
|
-
middleware instead of being part of the application. Now, csrf
|
31
|
-
protection will be enforced. This change makes it so the Roda
|
32
|
-
application operates the same way regardless of whether it is run
|
33
|
-
as the rack application or used as rack middleware.
|
34
|
-
|
35
|
-
Because of this change, if you are nesting roda applications using
|
36
|
-
the middleware plugin, you may need to use the middleware plugin's
|
37
|
-
:env_var option to specify the environment variable used to
|
38
|
-
indicate to the Roda application that it is being run as middleware.
|
39
|
-
|
40
|
-
= Backwards Compatibility
|
41
|
-
|
42
|
-
* See above changes to the middleware plugin if you are using
|
43
|
-
middleware inside a Roda application that uses the middleware
|
44
|
-
plugin.
|
@@ -1,53 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* A public plugin has been added. This adds an r.public method
|
4
|
-
for serving all files in the public directory. The public
|
5
|
-
plugin can replace usage of the static plugin, and is more
|
6
|
-
flexible. You can place r.public at any point in the routing
|
7
|
-
tree, and it will use the remaining path to lookup the file
|
8
|
-
in the public directory. You can also pass the :gzip option
|
9
|
-
when loading the plugin, and it will serve already gzipped
|
10
|
-
files to the client if the client supports gzipped transfer
|
11
|
-
encoding and the file exists with a .gz extension. Example:
|
12
|
-
|
13
|
-
plugin :public
|
14
|
-
route do |r|
|
15
|
-
# Serve public files before routing
|
16
|
-
r.public
|
17
|
-
|
18
|
-
# ...
|
19
|
-
end
|
20
|
-
|
21
|
-
* The :header matcher added by the header_matchers plugin now
|
22
|
-
automatically prefixes the key with HTTP_ when looking it up in
|
23
|
-
the environment, if the :header_matcher_prefix application
|
24
|
-
option is set. This behavior will probably be the default in
|
25
|
-
Roda 3.
|
26
|
-
|
27
|
-
# Before
|
28
|
-
r.on :header => 'http_accept'
|
29
|
-
|
30
|
-
# Now, with :header_matcher_prefix=>true application option
|
31
|
-
r.on :header => 'accept'
|
32
|
-
|
33
|
-
* The content_for plugin now accepts an :append=>true option to
|
34
|
-
support appending to the existing content instead of overwriting
|
35
|
-
the existing content if called multiple times. This behavior
|
36
|
-
will probably be the default in Roda 3.
|
37
|
-
|
38
|
-
# Before
|
39
|
-
content_for(:form, 'a')
|
40
|
-
content_for(:form, 'b')
|
41
|
-
content_for(:form) # => 'b'
|
42
|
-
|
43
|
-
# Now, with :append=>true option
|
44
|
-
content_for(:form, 'a')
|
45
|
-
content_for(:form, 'b')
|
46
|
-
content_for(:form) # => 'ab'
|
47
|
-
|
48
|
-
= Other Improvements
|
49
|
-
|
50
|
-
* The r.send_file method in the sinatra_helpers plugin now works
|
51
|
-
correctly when using rack 2.
|
52
|
-
|
53
|
-
* The specs now run correctly on Windows.
|