Sinatra v1.1.0 Release Notes

Release Date: 2010-10-24 // over 13 years ago
    • Before and after filters now support pattern matching, including the ability to use captures: "before('/user/:name') { |name| ... }". This avoids manual path checking. No performance loss if patterns are avoided. (Konstantin Haase)

    • It is now possible to render SCSS files with the scss method, which behaves exactly like sass except for the different file extension and assuming the SCSS syntax. (Pedro Menezes, Konstantin Haase)

    • Added liquid, markdown, nokogiri, textile, rdoc, radius, markaby, and coffee rendering methods for rendering Liquid, Markdown, Nokogiri, Textile, RDoc, Radius, Markaby and CoffeeScript templates. (Konstantin Haase)

    • Now supports byte-range requests (the HTTP_RANGE header) for static files. Multi-range requests are not supported, however. (Jens Alfke)

    • You can now use #settings method from class and top level for convenience. (Konstantin Haase)

    • Setting multiple values now no longer relies on #to_hash and therefore accepts any Enumerable as parameter. (Simon Rozet)

    • Nested templates default the layout option to false rather than true. This eases the use of partials. If you wanted to render one haml template embedded in another, you had to call haml :partial, {}, :layout => false. As you almost never want the partial to be wrapped in the standard layout in this situation, you now only have to call haml :partial. Passing in layout explicitly is still possible. (Konstantin Haase)

    • If a the return value of one of the render functions is used as a response body and the content type has not been set explicitly, Sinatra chooses a content type corresponding to the rendering engine rather than just using "text/html". (Konstantin Haase)

    • README is now available in Chinese (Wu Jiang), French (Mickael Riga), German (Bernhard Essl, Konstantin Haase, burningTyger), Hungarian (Janos Hardi) and Spanish (Gabriel Andretta). The extremely outdated Japanese README has been updated (Kouhei Yanagita).

    • It is now possible to access Sinatra's template_cache from the outside. (Nick Sutterer)

    • The last_modified method now also accepts DateTime instances and makes sure the header will always be set to a string. (Konstantin Haase)

    • 599 now is a legal status code. (Steve Shreeve)

    • This release is compatible with Ruby 1.9.2. Sinatra was trying to read non existent files Ruby added to the call stack. (Shota Fukumori, Konstantin Haase)

    • Prevents a memory leak on 1.8.6 in production mode. Note, however, that this is due to a bug in 1.8.6 and request will have the additional overhead of parsing templates again on that version. It is recommended to use at least Ruby 1.8.7. (Konstantin Haase)

    • Compares last modified date correctly. last_modified was halting only when the 'If-Modified-Since' header date was equal to the time specified. Now, it halts when is equal or later than the time specified (Gabriel Andretta).

    • Sinatra is now usable in combination with Rails 3. When mounting a Sinatra application under a subpath in Rails 3, the PATH_INFO is not prefixed with a slash and no routes did match. (José Valim)

    • Better handling of encodings in 1.9, defaults params encoding to UTF-8. (Konstantin Haase)

    • show_exceptions handling is now triggered after custom error handlers, if it is set to :after_handlers, thus not disabling those handler in development mode. (pangel, Konstantin Haase)

    • Added ability to handle weighted HTTP_ACCEPT headers. (Davide D'Agostino)

    • send_file now always respects the :type option if set. Previously it was discarded if no matching mime type was found, which made it impossible to directly pass a mime type. (Konstantin Haase)

    • redirect always redirects to an absolute URI, even if a relative URI was passed. Ensures compatibility with RFC 2616 section 14.30. (Jean-Philippe Garcia Ballester, Anthony Williams)

    • Broken examples for using Erubis, Haml and Test::Unit in README have been fixed. (Nick Sutterer, Doug Ireton, Jason Stewart, Eric Marden)

    • Sinatra now handles SIGTERM correctly. (Patrick Collison)

    • Fixes an issue with inline templates in modular applications that manually call run!. (Konstantin Haase)

    • Spaces after inline template names are now ignored (Konstantin Haase)

    • It's now possible to use Sinatra with different package management systems defining a custom require. (Konstantin Haase)

    • Lighthouse has been dropped in favor of GitHub issues.

    • Tilt is now a dependency and therefore no longer ships bundled with Sinatra. (Ryan Tomayko, Konstantin Haase)

    • Sinatra now depends on Rack 1.1 or higher. Rack 1.0 is no longer supported. (Konstantin Haase)