forked from soveran/cuba
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jeremyevans:master' into master
- Loading branch information
Showing
160 changed files
with
5,900 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
/www/public/rdoc/ | ||
/spec/iv-*.erb | ||
/spec/pid-* | ||
Gemfile.lock | ||
/spec/render_coverage-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
= New Features | ||
|
||
* A render_coverage plugin has been added, which will cause compiled | ||
template code to be saved to a folder and loaded using load instead | ||
of eval. This allows for coverage to work for the compiled template | ||
code in Ruby versions before 3.2. It can also allow for verbose | ||
syntax warnings in compiled template code (ignored by eval), and | ||
can also be useful for static analysis of compiled template code. | ||
This plugin requires tilt 2.1+. | ||
|
||
* The exception_page plugin now supports exception_page_{css,js} | ||
instance methods for overriding the CSS and JavaScript on the | ||
generated exception page. | ||
|
||
= Other Improvements | ||
|
||
* Using inline templates (render/view :inline option) no longer keeps | ||
a reference to the Roda instance that caches the template. | ||
|
||
= Backwards Compatibility | ||
|
||
* The Render::TemplateMtimeWrapper API has changed. Any external | ||
use of this class needs to be updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
= New Feature | ||
|
||
* A custom_block_results plugin has been added for custom handling | ||
of block results. This allows routing blocks to return | ||
arbitrary objects instead of just String, nil, and false, and | ||
to have custom handling for them. For example, if you want to | ||
be able to have your routing blocks return the status code to use, | ||
you could do: | ||
|
||
plugin :custom_block_results | ||
|
||
handle_block_result Integer do |result| | ||
response.status_code = result | ||
end | ||
|
||
route do |r| | ||
200 | ||
end | ||
|
||
While the expected use of the handle_block_result method is with | ||
class arguments, you can use any argument that implements an | ||
appropriate === method. | ||
|
||
The symbol_views and json plugins, which support additional block | ||
results, now use the custom_block_results plugin internally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
= New Feature | ||
|
||
* Roda.run in the multi_run plugin now accepts blocks, to allow | ||
autoloading of apps to dispatch to: | ||
|
||
class App < Roda | ||
plugin :multi_run | ||
|
||
run("other_app"){OtherApp} | ||
|
||
route do |r| | ||
r.multi_run | ||
end | ||
end | ||
|
||
With the above example, the block is not evaluated until a | ||
request for the /other_app branch is received. If OtherApp is | ||
autoloaded, this can speed up application startup and partial | ||
testing. When freezing the application (for production use), | ||
the block is eagerly loaded, so that requests to the | ||
/other_app branch do not call the block on every request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
= New Feature | ||
|
||
* The symbol_matcher method in the symbol_matchers plugin now | ||
supports a block to allow for type conversion of matched | ||
segments: | ||
|
||
symbol_matcher(:date, /(\d\d\d\d)-(\d\d)-(\d\d)/) do |y, m, d| | ||
[Date.new(y.to_i, m.to_i, d.to_i)] | ||
end | ||
|
||
route do |r| | ||
r.on :date do |date| | ||
# date is an instance of Date | ||
end | ||
end | ||
|
||
As shown above, the block should return an array of objects to yield | ||
to the match block. | ||
|
||
If you have a segment match the passed regexp, but decide during block | ||
processing that you do not want to treat it as a match, you can have the | ||
block return nil or false. This is useful if you want to make sure you | ||
are using valid data: | ||
|
||
symbol_matcher(:date, /(\d\d\d\d)-(\d\d)-(\d\d)/) do |y, m, d| | ||
y = y.to_i | ||
m = m.to_i | ||
d = d.to_i | ||
[Date.new(y, m, d)] if Date.valid_date?(y, m, d) | ||
end | ||
|
||
When providing a block when using the symbol_matchers method, that | ||
symbol may not work with the params_capturing plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
= New Features | ||
|
||
* A plain_hash_response_headers plugin has been added. On Rack 3, | ||
this changes Roda to use a plain hash for response headers (as it | ||
does on Rack 2), instead of using Rack::Headers (the default on | ||
Rack 3). For a minimal app, using this plugin can almost double | ||
the performance on Rack 3. Before using this plugin, you should | ||
make sure that all response headers set explictly in your | ||
application are already lower-case. | ||
|
||
= Improvements | ||
|
||
* Roda now natively uses lower-case for all response headers set | ||
implicitly when using Rack 3. Previously, Roda used mixed-case | ||
response headers and had Rack::Headers handle the conversion to | ||
lower-case (Rack 3 requires lower-case response headers). Note | ||
that Rack::Headers is still used for response headers by default | ||
on Rack 3, as applications may not have converted to using | ||
lower-case response headers. |
Oops, something went wrong.