Sinatra 1.2 is out and thanks to R. Konstantin Haase and others, The Chairman has added a number of ditties to his set list. Highlights of the release include:

  • Slim support
  • Inline Markaby
  • Layout engines, so you can have a layout in Haml and templates in ERb for instance
  • Conditional before, after filters
  • URL helper
  • Templates with different scopes
  • Configurable template lookup

For Ruby 1.9 users, you can now use named captures in your routes:

get %r{/(?<year>d{4})/(?<month>d{2})/(?<day>d{2})/?} do
  date = Date.new params[:year].to_i, params[:month].to_i, params[:day].to_i
  @posts = Post.pubished_on date
  erb :posts
end

As Sinatra fans, we’re excited about this release anxious to see what projects like Padrino and NestaCMS can do with it.

[Source on GitHub] [Announcement] [Web site]


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.