roda 3.28.0 → 3.33.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 +40 -0
- data/README.rdoc +15 -1
- data/doc/conventions.rdoc +17 -8
- data/doc/release_notes/3.29.0.txt +15 -0
- data/doc/release_notes/3.30.0.txt +14 -0
- data/doc/release_notes/3.31.0.txt +11 -0
- data/doc/release_notes/3.32.0.txt +42 -0
- data/doc/release_notes/3.33.0.txt +8 -0
- data/lib/roda.rb +3 -0
- data/lib/roda/plugins/_symbol_regexp_matchers.rb +2 -0
- data/lib/roda/plugins/assets.rb +26 -5
- data/lib/roda/plugins/caching.rb +2 -0
- data/lib/roda/plugins/common_logger.rb +1 -1
- data/lib/roda/plugins/content_security_policy.rb +2 -0
- data/lib/roda/plugins/default_headers.rb +2 -0
- data/lib/roda/plugins/exception_page.rb +9 -5
- data/lib/roda/plugins/hash_matcher.rb +1 -1
- data/lib/roda/plugins/header_matchers.rb +5 -1
- data/lib/roda/plugins/indifferent_params.rb +4 -0
- data/lib/roda/plugins/partials.rb +33 -6
- data/lib/roda/plugins/path.rb +42 -15
- data/lib/roda/plugins/placeholder_string_matchers.rb +2 -0
- data/lib/roda/plugins/public.rb +25 -17
- data/lib/roda/plugins/relative_path.rb +73 -0
- data/lib/roda/plugins/render.rb +17 -5
- data/lib/roda/plugins/render_each.rb +11 -3
- data/lib/roda/plugins/run_append_slash.rb +1 -1
- data/lib/roda/plugins/symbol_matchers.rb +2 -2
- data/lib/roda/version.rb +1 -1
- metadata +13 -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/1.3.0.txt
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
= Preparation for Roda 2
|
|
2
|
-
|
|
3
|
-
* In Roda 2 (the next version), the PATH_INFO and SCRIPT_NAME
|
|
4
|
-
env variables will not be modified during routing. Instead,
|
|
5
|
-
Roda will use the static_path_info plugin behavior by default.
|
|
6
|
-
Users are strongly encouraged to use the static_path_info
|
|
7
|
-
plugin to make sure their apps will work with Roda 2.
|
|
8
|
-
|
|
9
|
-
* In Roda 2, Roda#initialize will take the env hash, and #call
|
|
10
|
-
will take the route block. The private #_route method will be
|
|
11
|
-
eliminated. This should not affect applications, but it will
|
|
12
|
-
affect plugins that override these methods.
|
|
13
|
-
|
|
14
|
-
* The issues mentioned below should all have deprecation warnings,
|
|
15
|
-
except where noted.
|
|
16
|
-
|
|
17
|
-
== New Plugins to Replace Deprecated Features
|
|
18
|
-
|
|
19
|
-
* RodaResponse#set_cookie and #delete_cookie have been moved to the
|
|
20
|
-
cookies plugin.
|
|
21
|
-
|
|
22
|
-
* Roda.request_module and .response_module have been moved to the
|
|
23
|
-
module_include plugin.
|
|
24
|
-
|
|
25
|
-
* Roda.hash_matcher has been moved to the hash_matcher plugin.
|
|
26
|
-
|
|
27
|
-
* The :extension hash matcher has been moved to the path_machers
|
|
28
|
-
plugin. This plugin also contains new :prefix and :suffix hash
|
|
29
|
-
matchers.
|
|
30
|
-
|
|
31
|
-
* The :param and :param! hash matchers have been moved to the
|
|
32
|
-
param_matchers plugin.
|
|
33
|
-
|
|
34
|
-
== Other Deprecation Issues
|
|
35
|
-
|
|
36
|
-
* The :opts render plugin option and :opts option to render and
|
|
37
|
-
view are now deprecated. Use the :template_opts option instead.
|
|
38
|
-
|
|
39
|
-
* RodaRequest#full_path_info has been deprecated, switch to using
|
|
40
|
-
#path.
|
|
41
|
-
|
|
42
|
-
* Mutating plugin option hashes for the chunked, default_headers,
|
|
43
|
-
error_email, json, and render plugins is now deprecated, these
|
|
44
|
-
option hashes will be frozen in Roda 2.
|
|
45
|
-
|
|
46
|
-
* The :header hash matcher in the header_matchers plugin now
|
|
47
|
-
gives a deprecation warning, because in Roda 2, the matcher will
|
|
48
|
-
yield the value of the header to the block. To get the new
|
|
49
|
-
behavior and silence the deprecation warning, you need to set an
|
|
50
|
-
option:
|
|
51
|
-
|
|
52
|
-
Roda.opts[:match_header_yield] = true
|
|
53
|
-
|
|
54
|
-
* Mutating json_result_classes directly in the json plugin is now
|
|
55
|
-
deprecated. You should now pass a :classes option to the plugin
|
|
56
|
-
specifying the classes to convert, if you want to handle classes
|
|
57
|
-
other than Array and Hash. There will not be a deprecation warning
|
|
58
|
-
if you attempt to mutate json_result_classes.
|
|
59
|
-
|
|
60
|
-
= New Features
|
|
61
|
-
|
|
62
|
-
* The Roda.freeze method now freezes internal datastructures to avoid
|
|
63
|
-
thread safety issues. The plugins that ship with Roda will freeze
|
|
64
|
-
their datastructures when Roda.freeze is called. It is recommended
|
|
65
|
-
that production applications call freeze on the application after
|
|
66
|
-
fully loading it, especially if they are using a threaded webserver
|
|
67
|
-
and a non-MRI ruby.
|
|
68
|
-
|
|
69
|
-
* A delete_empty_headers plugin has been added that automatically
|
|
70
|
-
deletes headers set to the empty string. This makes it simpler to
|
|
71
|
-
delete default headers if they shouldn't be set for a specific
|
|
72
|
-
request.
|
|
73
|
-
|
|
74
|
-
* A class_delegate method has been added to the delegate plugin. This
|
|
75
|
-
makes it easier to create instance methods that call class methods.
|
|
76
|
-
|
|
77
|
-
* Roda::RodaMajorVersion, RodaMinorVersion, and RodaPatchVersion
|
|
78
|
-
constants have been added.
|
|
79
|
-
|
|
80
|
-
= Other Improvements
|
|
81
|
-
|
|
82
|
-
* The error_handler plugin now uses a new response instead of reusing
|
|
83
|
-
the existing response. This fixes cases where changing the
|
|
84
|
-
Content-Type and then raising an exception would result in a error
|
|
85
|
-
page that used the previously set Content-Type.
|
|
86
|
-
|
|
87
|
-
* The not_found plugin now clears previous set headers before calling
|
|
88
|
-
not found. This fixes cases where Content-Type was set previously,
|
|
89
|
-
and also fixes an incorrect Content-Length being used for the
|
|
90
|
-
response.
|
|
91
|
-
|
|
92
|
-
* The static_path_info plugin now restores the original SCRIPT_NAME
|
|
93
|
-
and PATH_INFO before returning from r.run, fixing usage with some
|
|
94
|
-
middleware.
|
|
95
|
-
|
|
96
|
-
* The multi_run plugin now works when subclassing the app.
|
|
97
|
-
|
|
98
|
-
* The default_headers plugin is now faster by skipping an unnecessary
|
|
99
|
-
hash duplication.
|
|
100
|
-
|
|
101
|
-
* A Gemfile has been added to make development slightly easier.
|
|
102
|
-
|
|
103
|
-
= Backwards Compatibility
|
|
104
|
-
|
|
105
|
-
* RodaResponse is no longer a subclass of Rack::Response, it is now a
|
|
106
|
-
subclass of Object. This shouldn't have an effect unless you were
|
|
107
|
-
calling a method on an instance that was defined by Rack::Response
|
|
108
|
-
and not RodaResponse, but most of those methods would have raised
|
|
109
|
-
exceptions.
|
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.
|