All Versions
60
Latest Version
Avg Release Cycle
118 days
Latest Release
509 days ago

Changelog History
Page 5

  • v1.2.0 Changes

    March 03, 2011
    • Added slim rendering method for rendering Slim templates. (Steve Hodgkiss)

    • The markaby rendering method now allows passing a block, making inline usage possible. Requires Tilt 1.2 or newer. (Konstantin Haase)

    • All render methods now take a :layout_engine option, allowing to use a layout in a different template language. Even more useful than using this directly (erb :index, :layout_engine => :haml) is setting this globally for a template engine that otherwise does not support layouts, like Markdown or Textile (set :markdown, :layout_engine => :erb). (Konstantin Haase)

    • Before and after filters now support conditions, both with and without patterns (before '/api/*', :agent => /Songbird/). (Konstantin Haase)

    • Added a url helper method which constructs absolute URLs. Copes with reverse proxies and Rack handlers correctly. Aliased to to, so you can write redirect to('/foo'). (Konstantin Haase)

    • If running on 1.9, patterns for routes and filters now support named captures: get(%r{/hi/(?<name>[^/?#]+)}) { "Hi #{params['name']}" }. (Steve Price)

    • All rendering methods now take a :scope option, which renders them in another context. Note that helpers and instance variables will be unavailable if you use this feature. (Paul Walker)

    • The behavior of redirect can now be configured with absolute_redirects and prefixed_redirects. (Konstantin Haase)

    • send_file now allows overriding the Last-Modified header, which defaults to the file's mtime, by passing a :last_modified option. (Konstantin Haase)

    • You can use your own template lookup method by defining find_template. This allows, among other things, using more than one views folder. (Konstantin Haase)

    • Largely improved documentation. (burningTyger, Vasily Polovnyov, Gabriel Andretta, Konstantin Haase)

    • Improved error handling. (cactus, Konstantin Haase)

    • Skip missing template engines in tests correctly. (cactus)

    • Sinatra now ships with a Gemfile for development dependencies, since it eases supporting different platforms, like JRuby. (Konstantin Haase)

  • v1.1.4 Changes

    April 13, 2011
    • Compatible with Tilt 1.3. (Konstantin Haase)
  • v1.1.3 Changes

    February 20, 2011
    • Fixed issues with user_agent condition if the user agent header is missing. (Konstantin Haase)

    • Fix some routing tests that have been skipped by accident (Ross A. Baker)

    • Fix rendering issues with Builder and Nokogiri (Konstantin Haase)

    • Replace last_modified helper with better implementation. (cactus, Konstantin Haase)

    • Fix issue with charset not being set when using provides condition. (Konstantin Haase)

    • Fix issue with render not picking up all alternative file extensions for a rendering engine - it was not possible to register ".html.erb" without tricks. (Konstantin Haase)

  • v1.1.2 Changes

    October 25, 2010

    Like 1.1.1, but with proper CHANGES file.

  • v1.1.1 Changes

    October 25, 2010
    • README has been translated to Russian (Nickolay Schwarz, Vasily Polovnyov) and Portuguese (Luciano Sousa).

    • Nested templates without a :layout option can now be used from the layout template without causing an infinite loop. (Konstantin Haase)

    • Inline templates are now encoding aware and can therefore be used with unicode characters on Ruby 1.9. Magic comments at the beginning of the file will be honored. (Konstantin Haase)

    • Default app_file is set correctly when running with bundler. Using bundler caused Sinatra not to find the app_file and therefore not to find the views folder on it's own. (Konstantin Haase)

    • Better handling of Content-Type when using send_file: If file extension is unknown, fall back to application/octet-stream and do not override content type if it has already been set, except if :type is passed explicitly (Konstantin Haase)

    • Path is no longer cached if changed between handlers that do pattern matching. This means you can change request.path_info in a pattern matching before filter. (Konstantin Haase)

    • Headers set by cache_control now always set max_age as an Integer, making sure it is compatible with RFC2616. (Konstantin Haase)

    • Further improved handling of string encodings on Ruby 1.9, templates now honor default_encoding and URLs support unicode characters. (Konstantin Haase)

  • v1.1.0 Changes

    October 24, 2010
    • 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)

  • v1.0 Changes

    March 23, 2010
    • It's now possible to register blocks to run after each request using after filters. After filters run at the end of each request, after routes and error handlers. (Jimmy Schementi)

    • Sinatra now uses Tilt http://github.com/rtomayko/tilt for rendering templates. This adds support for template caching, consistent template backtraces, and support for new template engines, like mustache and liquid. (Ryan Tomayko)

    • ERB, Erubis, and Haml templates are now compiled the first time they're rendered instead of being string eval'd on each invocation. Benchmarks show a 5x-10x improvement in render time. This also reduces the number of objects created, decreasing pressure on Ruby's GC. (Ryan Tomayko)

    • New 'settings' method gives access to options in both class and request scopes. This replaces the 'options' method. (Chris Wanstrath)

    • New boolean 'reload_templates' setting controls whether template files are reread from disk and recompiled on each request. Template read/compile is cached by default in all environments except development. (Ryan Tomayko)

    • New 'erubis' helper method for rendering ERB template with Erubis. The erubis gem is required. (Dylan Egan)

    • New 'cache_control' helper method provides a convenient way of setting the Cache-Control response header. Takes a variable number of boolean directives followed by a hash of value directives, like this: cache_control :public, :must_revalidate, :max_age => 60 (Ryan Tomayko)

    • New 'expires' helper method is like cache_control but takes an integer number of seconds or Time object: expires 300, :public, :must_revalidate (Ryan Tomayko)

    • New request.secure? method for checking for an SSL connection. (Adam Wiggins)

    • Sinatra apps can now be run with a -o <addr> argument to specify the address to bind to. (Ryan Tomayko)

    • Rack::Session::Cookie is now added to the middleware pipeline when running in test environments if the :sessions option is set. (Simon Rozet)

    • Route handlers, before filters, templates, error mappings, and middleware are now resolved dynamically up the inheritance hierarchy when needed instead of duplicating the superclass's version when a new Sinatra::Base subclass is created. This should fix a variety of issues with extensions that need to add any of these things to the base class. (Ryan Tomayko)

    • Exception error handlers always override the raise_errors option now. Previously, all exceptions would be raised outside of the application when the raise_errors option was enabled, even if an error handler was defined for that exception. The raise_errors option now controls whether unhandled exceptions are raised (enabled) or if a generic 500 error is returned (disabled). (Ryan Tomayko)

    • The X-Cascade response header is set to 'pass' when no matching route is found or all routes pass. (Josh Peek)

    • Filters do not run when serving static files anymore. (Ryan Tomayko)

    • pass takes an optional block to be used as the route handler if no subsequent route matches the request. (Blake Mizerany)

    🚚 The following Sinatra features have been obsoleted (removed entirely) in 🚀 the 1.0 release:

    • The sinatra/test library is obsolete. This includes the Sinatra::Test module, the Sinatra::TestHarness class, and the get_it, post_it, put_it, delete_it, and head_it helper methods. The Rack::Test library should be used instead.

    • Test framework specific libraries (sinatra/test/spec, sinatra/test/bacon,sinatra/test/rspec, etc.) are obsolete. See http://www.sinatrarb.com/testing.html for instructions on setting up a testing environment under each of these frameworks.

    • Sinatra::Default is obsolete; use Sinatra::Base instead. Sinatra::Base acts more like Sinatra::Default in development mode. For example, static file serving and sexy development error pages are enabled by default.

    • Auto-requiring template libraries in the erb, builder, haml, and sass methods is obsolete due to thread-safety issues. You must require the template libraries explicitly in your app.

    • The :views_directory option to rendering methods is obsolete; use :views instead.

    • The :haml and :sass options to rendering methods are obsolete. Template engine options should be passed in the second Hash argument instead.

    • The use_in_file_templates method is obsolete. Use enable :inline_templates or set :inline_templates, 'path/to/file'

    • The 'media_type' helper method is obsolete. Use 'mime_type' instead.

    • The 'mime' main and class method is obsolete. Use 'mime_type' instead.

    • The request-level send_data method is no longer supported.

    • The Sinatra::Event and Sinatra::EventContext classes are no longer supported. This may effect extensions written for versions prior to 0.9.2. See Writing Sinatra Extensions for the officially supported extensions API.

    • The set_option and set_options methods are obsolete; use set instead.

    • The :env setting (settings.env) is obsolete; use :environment instead.

    • The request level stop method is obsolete; use halt instead.

    • The request level entity_tag method is obsolete; use etag instead.

    • The request level headers method (HTTP response headers) is obsolete; use response['Header-Name'] instead.

    • Sinatra.application is obsolete; use Sinatra::Application instead.

    • Using Sinatra.application = nil to reset an application is obsolete. This should no longer be necessary.

    • Using Sinatra.default_options to set base configuration items is obsolete; use Sinatra::Base.set(key, value) instead.

    • The Sinatra::ServerError exception is obsolete. All exceptions raised within a request are now treated as internal server errors and result in a 500 response status.

    • The :methodoverride' option to enable/disable the POST _method hack is obsolete; use:method_override` instead.

  • v0.9.2 Changes

    May 18, 2009
    • This version is compatible with Rack 1.0. [Rein Henrichs]

    • The development-mode unhandled exception / error page has been greatly enhanced, functionally and aesthetically. The error page is used when the :show_exceptions option is enabled and an exception propagates outside of a route handler or before filter. [Simon Rozet / Matte Noble / Ryan Tomayko]

    • Backtraces that move through templates now include filenames and line numbers where possible. [#51 / S. Brent Faulkner]

    • All templates now have an app-level option for setting default template options (:haml, :sass, :erb, :builder). The app-level option value must be a Hash if set and is merged with the template options specified to the render method (Base#haml, Base#erb, Base#builder). [S. Brent Faulkner, Ryan Tomayko]

    • The method signature for all template rendering methods has been unified: "def engine(template, options={}, locals={})". The options Hash now takes the generic :views, :layout, and :locals options but also any template-specific options. The generic options are removed before calling the template specific render method. Locals may be specified using either the :locals key in the options hash or a second Hash option to the rendering method. [#191 / Ryan Tomayko]

    • The receiver is now passed to "configure" blocks. This allows for the following idiom in top-level apps: configure { |app| set :foo, app.root + '/foo' } [TJ Holowaychuck / Ryan Tomayko]

    • The "sinatra/test" lib is deprecated and will be removed in Sinatra 1.0. This includes the Sinatra::Test module and Sinatra::TestHarness class in addition to all the framework test helpers that were deprecated in 0.9.1. The Rack::Test lib should be used instead: http://gitrdoc.com/brynary/rack-test [#176 / Simon Rozet]

    • Development mode source file reloading has been removed. The "shotgun" (http://rtomayko.github.com/shotgun/) program can be used to achieve the same basic functionality in most situations. Passenger users should use the "tmp/always_restart.txt" file (http://tinyurl.com/c67o4h). [#166 / Ryan Tomayko]

    • Auto-requiring template libs in the erb, builder, haml, and sass methods is deprecated due to thread-safety issues. You must require the template libs explicitly in your app file. [Simon Rozet]

    • A new Sinatra::Base#route_missing method was added. route_missing is sent when no route matches the request or all route handlers pass. The default implementation forwards the request to the downstream app when running as middleware (i.e., "@app" is non-nil), or raises a NotFound exception when no downstream app is defined. Subclasses can override this method to perform custom route miss logic. [Jon Crosby]

    • A new Sinatra::Base#route_eval method was added. The method yields to the block and throws :halt with the result. Subclasses can override this method to tap into the route execution logic. [TJ Holowaychuck]

    • Fix the "-x" (enable request mutex / locking) command line argument. Passing -x now properly sets the :lock option. [S. Brent Faulkner, Ryan Tomayko]

    • Fix writer ("foo=") and predicate ("foo?") methods in extension modules not being added to the registering class. [#172 / Pat Nakajima]

    • Fix in-file templates when running alongside activesupport and fatal errors when requiring activesupport before sinatra [#178 / Brian Candler]

    • Fix various issues running on Google AppEngine. [Samuel Goebert, Simon Rozet]

    • Fix in-file templates END detection when END exists with other stuff on a line [Yoji Shidara]

  • v0.9.1 Changes

    March 01, 2009
    • Sinatra now runs under Ruby 1.9.1 [#61]

    • Route patterns (splats, :named, or Regexp captures) are now passed as arguments to the block. [#140]

    • The "helpers" method now takes a variable number of modules along with the normal block syntax. [#133]

    • New request-level #forward method for middleware components: passes the env to the downstream app and merges the response status, headers, and body into the current context. [#126]

    • Requests are now automatically forwarded to the downstream app when running as middleware and no matching route is found or all routes pass.

    • New simple API for extensions/plugins to add DSL-level and request-level methods. Use Sinatra.register(mixin) to extend the DSL with all public methods defined in the mixin module; use Sinatra.helpers(mixin) to make all public methods defined in the mixin module available at the request level. [#138] See http://www.sinatrarb.com/extensions.html for details.

    • Named parameters in routes now capture the "." character. This makes routes like "/:path/:filename" match against requests like "/foo/bar.txt"; in this case, "params[:filename]" is "bar.txt". Previously, the route would not match at all.

    • Added request-level "redirect back" to redirect to the referring URL.

    • Added a new "clean_trace" option that causes backtraces dumped to rack.errors and displayed on the development error page to omit framework and core library backtrace lines. The option is enabled by default. [#77]

    • The ERB output buffer is now available to helpers via the @_out_buf instance variable.

    • It's now much easier to test sessions in unit tests by passing a ":session" option to any of the mock request methods. e.g., get '/', {}, :session => { 'foo' => 'bar' }

    • The testing framework specific files ('sinatra/test/spec', 'sinatra/test/bacon', 'sinatra/test/rspec', etc.) have been deprecated. See http://sinatrarb.com/testing.html for instructions on setting up a testing environment with these frameworks.

    • The request-level #send_data method from Sinatra 0.3.3 has been added for compatibility but is deprecated.

    • Fix :provides causing crash on any request when request has no Accept header [#139]

    • Fix that ERB templates were evaluated twice per "erb" call.

    • Fix app-level middleware not being run when the Sinatra application is run as middleware.

    • Fixed some issues with running under Rack's CGI handler caused by writing informational stuff to stdout.

    • Fixed that reloading was sometimes enabled when starting from a rackup file [#110]

    • Fixed that "." in route patterns erroneously matched any character instead of a literal ".". [#124]

  • v0.9.1.1 Changes

    March 09, 2009
    • Fix directory traversal vulnerability in default static files route. See [#177] for more info.