Padrino

Padrino 0.9.27 - Project settings, routing, compatibility and bug fixes

Today, we released a new version of Padrino bringing us to 0.9.27. This release is only a week after our last hotfix release because we wanted to keep up the speed as we approach our 0.10.0 release that will coincide with the Sinatra 1.3 release.

We have also significantly improved our release processes as we approach 1.0 and now the continuous integration measures we put in place run all of our tests on every ruby version, a set of elaborate integration tests as well as full web benchmarks to measure our requests per second versus other ruby frameworks.

This release is primarily compatibility and bug fixes but also contains a few new features involving project-wide settings, reverse route recognition, and offline and test generation updates. Details of the features and fixes are below.

If you want to hear more about Padrino, a podcast was recently released on Rubiverse.

Project-wide Settings

In this release, we have added the notion of ‘project’ settings that are inherited by every Padrino application within the project. This can be used to set any properties but is particularly useful for sharing sessions across your apps. These project-wide settings are intended to live in config/apps.rb and are generated in every new application.

# config/apps.rb
# Set the global project settings for your apps.
# These settings are inherited by your subapps.
# You can override these settings in each of your sub apps.
Padrino.configure_apps do
  enable :sessions
  set :foo, "bar"
end

Using this is optional and you can override these settings on a per-app basis as well. Commits are here, here, and here.

Reverse Route Recognition

We have occasionally had the need to access the current route from within a template in order to create links or determine the current page.

Given we have a route such as

# controllers.rb
controller :some do
  get :other, :map => "/custom/url/with-:foo" do; end
end

We have added the ability to recognize a url and retrieve the route:

# my_view.haml
url(:some, :other, :foo => :bar)
# => /custom/url/with-bar

We have also added the ability to get the current page:

# in a path like /posts/?search=bar&name=foo
= link_to "Sort by Name", current_path("sort" => :name)
= link_to "Sort by Date", current_path("sort" => :date)

Commits for this are here and here.

Compatibility Fixes

  • Upgrade to Sinatra 1.2.6 dependency from 1.2.4 by default
  • Make logger Sinatra 1.3 compatible commit
  • SCSS needs to rely on ‘sass’ gem instead of ‘haml’ commit
  • Use CouchRest::Model in favor of deprecated CouchRest::ExtendedDocument. Thanks to Burgestrand! commit
  • Use the sqlite3 gem as dependency for generated projects commit
  • Use SecureRandom to generate session secret commit
  • Partials can now be used directly with Sinatra from Padrino::Helpers commit, example
  • Adds MongoMapper rake task for dropping the database commit

Bug Fixes

  • Fix YAML by using ‘syck’ to parse by default commit
  • Fix to slim template in admin for destroy session commit
  • Offline generation of static js commit

Padrino 0.9.26 - Hotfix Release

We recently released 0.9.25 which was a milestone release with many significant improvements. Unfortunately, we let a few serious bugs slip into the release as well, so a hotfix release is required.

Before going into the fixes, just want to also preface with the fact that we are taking steps to make sure future releases are better tesed. First, we used to have a CI server but the server was no longer available so we have setup a new Hudson CI server to guarantee that a release works on a variety of ruby versions and platforms. Second, we are going to do a better job of testing edge releases on our applications before released. It is important to us that each release is rock-solid before we push that out to rubygems.

A breakdown of the details of this hotfix release is in the details.

There are several fixes that went into this release to patch issues users were experiencing after an upgrade:

HTTPRouter

There were a couple issues with http_router that were causing installation and usage issues on certain platforms. This has been fixed here by using the upgraded version. Thanks Josh!

Mongoid Rake Tasks

We had accidentally forked the mongoid rake tasks that come as part of Padrino, with a ‘gsub gone wrong’. bernerdschaefer:“https://github.com/bernerdschaefer” quickly identified and corrected the issue here. Thanks!

Shared Sessions

We have made several session security improvements in the last release but also inadvertently broke shared sessions between applications in a project. This was quickly identified and fixed here.

Development Reloader

Patches to enhance the development reloading capabilities also inadvertently broke reloading in some cases. This was fixed here and should be working as usual.

Compliance with Rack::CommonLogger

Small update, we have made our logging functions compliant with rack commonlogger, by adding a ‘write’ method here which was identified by Alex Sharp. Thanks!

Cache Installation

On Windows, users were reporting that installing the cache gem didn’t work. This was an easy issue to resolve “here”: and now installation should work as expected.

Test Generation

We have improved test generation to allow the various sub-apps in a project to have isolated testing environments. If you have three apps app1, app2, and app3 in a project, you can now do:

# Run all tests
$ padrino rake test
# Run tests for app 1
$ padrino rake test:app1
# Run tests for app 2
$ padrino rake test:app2

When tests are generated for an application, they are now separated into application-specific folders such as:

test/app1 test/app2 test/app3

Allowing more granular and isolated testing of each application.

Be sure to upgrade from 0.9.25 to 0.9.26 as soon as possible. If you are experiencing issues please let us know on the issue tracker.


  • Prev Page
  • Next Page