Padrino 0.18.7 release
Padrino 0.18.7 is a maintenance release for 0.18.x with 20 fixes: code reloading in development is faster and more dependable, provides: routes stop answering 500 for unusual formats, generated admin pages behave as expected, and several helpers and caches are safer on JRuby and under concurrent requests.
Changes
- Reloading in development. Boot and reloads take up to about half as long on Ruby 3.1 and newer (#2500). Classes required from folders the reloader skips, such as
config/, or defined by gems and reopened by project files, survive a reload instead of raisingNameErrororNoMethodError(#2572, #2575).StructandDataclasses, classes that alias built-in methods and classes that overrideto_sare reloaded like any other (#2569, #2556). - Routing and formats.
provides: :anyroutes no longer answer 500 for an unknown Accept header or URL extension, and media type strings inprovides:work (#2540, #2548). A format that isn't valid UTF-8 no longer raises (#2559).recognize_pathhandles percent-encoded paths, and Regexp routes with thenflag or a backreference no longer break requests (#2554). - Caching. The in-memory cache stores are safe to share between threads (#2544), and page caching looks a page up only under the key the route stores it under (#2565).
- Helpers. Date and time formats for Padrino's 21 locales load in every app (#2542).
number_to_currencyand its siblings round a BigDecimal exactly (#2571).truncateandtruncate_wordskeep to the requested length, andobject_model_nameworks without ActiveSupport (#2533, #2530; thanks, @rawsun007). - Generators and admin. Generated admin pages for Active Record and Mongoid models answer 404 for a missing record (#2532); Save and Save and continue go where their names say, and number, date and time columns get matching inputs (#2545). The generator warns when falcon or tailwind need a newer Ruby (#2564), and
--api --devprojects take padrino-support from the checkout (#2574). - JRuby. Template caches and the logger stay consistent when the first requests arrive at once (#2536).
Upgrading from 0.18.6
- In your Gemfile, change
gem 'padrino', '~> 0.18.6'(or'0.18.6') togem 'padrino', '~> 0.18.7', then runbundle update padrino(or, if it lists thepadrino-*gems, set each to~> 0.18.7and update them by name). - Check these, as listed in the changelog:
Padrino::Reloader.excludeentries name a folder or a file: an entry that is only the start of a name, such aslib/legacy_, no longer matcheslib/legacy_x.rb. List the folder or the file instead.- A project class that a gem adds methods to is now reloaded and comes back without those methods until the app restarts: define it in an excluded folder such as
config/. provides: :anyanswers only extensions with a registered MIME type:?format=text/csvnow gets a 404 (or 406 withtreat_format_as_accept). Send?format=csv, or register a type withmime_type.recognize_pathreturns nil for a path no route matches, instead of raisingNoMethodError.- The in-memory cache stores are locked, so they can't be used from a
traphandler: passthreadsafe: falsefor one that is. - Existing admin pages keep their files. To get the new Save behaviour and inputs, run
padrino g admin_page <Model>again and overwrite the page's controller and form, or edit them by hand. Edit the accounts page by hand, sinceg admin_pagereplaces its password fields.
Nothing else changes: Ruby 2.7.8 or later, Sinatra 4 and Rack 3 are still required.