Padrino 0.9.29 - Stability, compatibility and bug fix release
Today we are releasing Padrino 0.9.29, the latest in a series of stability and bug fix releases designed to bring us closer to the 0.10.0 release coinciding with the release of Sinatra 1.3! This release has several essential bug and compatibility fixes that ensure developers working with Padrino have a smooth experience. This release also might require a few changes due to a tweak in how session enabling works explained below.
The biggest changes are significant speed enhancements with our routing system, a complete rewrite of our development reloader, general core cleanup and Rake 0.9 and JRuby compatibility fixes. Read below for more details.
Upgrade Steps for 0.9.29
When upgrading to this latest release, you should take advantage of project-wide configurations and apply the following snippet to
# config/apps.rb Padrino.configure_apps do enable :sessions # $ padrino rake gen # $ rake secret set :session_secret, "long secret key pasted here" end
Adding this to the top of your app.rb will enable sessions in all applications within the project and use a secret session key to persist the session properly across all these apps. Make sure to run the ‘rake secret’ command and put the session key into the
:session_secret setting. Not doing this can create session related issues in your project.
Major improvements to Development Reloading
Over the last few releases, we have been experiencing a number of issues with our development reloader. Certain files weren't detected or reloaded properly, the reloader would hang up during a reload, certain files would be unloaded causing exceptions, et al.
In this release, we have worked closely with several users experiencing issues and in many ways completely rewrote the development code reloading system. We think the reloader is much more stable now and this also means faster boot and reloading times as well because the new reloader has been greatly streamlined.
Thanks specifically to @daddye of our core team for addressing these problems in the rewrite. Commits here, here, and here. Let's not forget even more commits here, here and finally here. Big thanks to bernerdschaefer for his help debugging and patching the reloader as well!
In addition to the development reloader, we have also cleaned and refactored several other modules within padrino-core. In particular we have cleaned up and refactored our
Padrino::Application, Gemfile generation, and the
- Refactored and cleaned up Padrino::Server: commit
- Removed old stuff from support_lite: commit
- Cleanup Gemfile to simplify loading: commit
- Cleanup support lite and improved compatiblity with jruby: commit
This cleanup is part of a larger effort as we work towards solidifying our internals.
Routing Speed Improvements
Our routing core http_router has been significantly optimized in the last few point versions for speed. We will be doing several benchmarks soon and will post them but for now suffice to say we have been making a lot of strides to make our routing even faster then before and this will be an ongoing effort. Thanks to Joshua Hull of our core team for creating probably the best Ruby request router available and it work for plain Sinatra too!
Truncate Words Helper
A new helper has been added called “truncate_words”. This is an alternative to the existing “truncate” method which shortens a string by characters, this helper shortens a string by words:
truncate_words("Once upon a time in a world far far away", :length => 4) => "Once upon a time..."
Better Dependency Handling
We have simplified dependency handling and the approach for adding new dependencies and load_paths to a Padrino application.
# config/boot.rb Padrino.before_load MyApp.load_paths << Padrino.root('app', 'observers') MyApp.dependencies << Padrino.root('other_app', 'controllers.rb') end
Bug and Compatibility Fixes
- Compatibility with CouchRest::Model 1.1: commit
- Fix bug with render and local vars: commit
- Honor / in Accept headers correctly – commit
- Rake 0.9 Compatibility: commit
- Rack::Flash now sweeps on every request by default: commit
- Supports skipping Padrino::Render with constant: commit