Padrino 0.18.5 release
Padrino 0.18.5 is a routing release for 0.18.x: url generation and request routing are faster, most of all in apps with many routes, and the routing methods no longer change the options hashes you give them.
Changes
- Faster routing. A request skips the routes whose path can't match its first characters. A
StopIterationraised while a route runs (in its block, filters or conditions) now reaches your error handlers instead of ending in a 404, and an earlier route for another verb that matches the path no longer fails the request (#2504). - Faster
url.urllooks routes up by name and expands each path once (#2502). - Options hashes left unchanged.
controller,before,after,parentandurlwork on a copy of the options hash (andexcept:orparent:list) they're given. A hash shared by severalcontrollercalls applies to each of them, anexcept:shared by several filters skips the same routes in each, a hash passed to severalurlcalls keeps itsfragment:, and frozen hashes no longer raiseFrozenError(#2512).
Upgrading from 0.18.4
- In your Gemfile, change
gem 'padrino', '~> 0.18.4'(or'0.18.4') togem 'padrino', '~> 0.18.5', then runbundle update padrino(or, if it lists thepadrino-*gems, set each to~> 0.18.5and update them by name). - Check these, as listed in the changelog:
- A hash passed to
controlleror a filter and then to a route now reaches the route whole. Aconditions:,use_format:orexcept:key in it raises when the app is defined (NoMethodError: undefined method 'conditions','use_format'or'except'), and amap:key becomes the route's own path, soget(:one, opts)withopts = { map: '/area' }now answers at/areainstead of/area/one. Give the route its own hash. - Default values given to
controller(such aslang: :de) are read when the controller is defined; changing that hash afterwards no longer changes the urls its routes generate. - A
StopIterationraised in a route now gives a 500, or your error handler's response, instead of a 404.
- A hash passed to
Nothing else changes: Ruby 2.7.8 or later, Sinatra 4 and Rack 3 are still required.