= 1.4.4 / 2013-10-21
* Allow setting layout to false in specifically for a singe rendering engine.
(Matt Wildig)
* Allow using wildcard in argument passed to `request.accept?`. (wilkie)
* Treat missing Accept header like wild card. (Patricio Mac Adden)
* Improve tests and documentation. (Darío Javier Cravero, Armen P., michelc,
Patricio Mac Adden, Matt Wildig, Vipul A M, utenmiki, George Timoschenko,
Diogo Scudelletti)
* Fix Ruby warnings. (Vipul A M, Patricio Mac Adden)
* Improve self-hosted server started by `run!` method or in classic mode.
(Tobias Bühlmann)
* Reduce objects allocated per request. (Vipul A M)
* Drop unused, undocumented options hash from Sinatra.new. (George Timoschenko)
* Keep Content-Length header when response is a `Rack::File` or when streaming.
(Patricio Mac Adden, George Timoschenko)
* Use reel if it's the only server available besides webrick. (Tobias Bühlmann)
* Add `disable :traps` so setting up signal traps for self hosted server can be
skipped. (George Timoschenko)
* The `status` option passed to `send_file` may now be a string. (George
Timoschenko)
* Reduce file size of dev mode images for 404 and 500 pages. (Francis Go)
= 1.4.3 / 2013-06-07
* Running a Sinatra file directly or via `run!` it will now ignore an
empty $PORT env variable. (noxqsgit)
* Improve documentation. (burningTyger, Patricio Mac Adden,
Konstantin Haase, Diogo Scudelletti, Dominic Imhof)
* Expose matched pattern as env["sinatra.route"]. (Aman Gupta)
* Fix warning on Ruby 2.0. (Craig Little)
* Improve running subset of tests in isolation. (Viliam Pucik)
* Reorder private/public methods. (Patricio Mac Adden)
* Loosen version dependency for rack, so it runs with Rails 3.2.
(Konstantin Haase)
* Request#accept? now returns true instead of a truthy value. (Alan Harris)
= 1.4.2 / 2013-03-21
* Fix parsing error for case where both the pattern and the captured part
contain a dot. (Florian Hanke, Konstantin Haase)
* Missing Accept header is treated like */*. (Greg Denton)
* Improve documentation. (Patricio Mac Adden, Joe Bottigliero)
= 1.4.1 / 2013-03-15
* Make delegated methods available in config.ru (Konstantin Haase)
= 1.4.0 / 2013-03-15
* Add support for LINK and UNLINK requests. (Konstantin Haase)
* Add support for Yajl templates. (Jamie Hodge)
* Add support for Rabl templates. (Jesse Cooke)
* Add support for Wlang templates. (Bernard Lambeau)
* Add support for Stylus templates. (Juan David Pastas, Konstantin Haase)
* You can now pass a block to ERb, Haml, Slim, Liquid and Wlang templates,
which will be used when calling `yield` in the template. (Alexey Muranov)
* When running in classic mode, no longer include Sinatra::Delegator in Object,
instead extend the main object only. (Konstantin Haase)
* Improved route parsing: "/:name.?:format?" with "/foo.png" now matches to
{name: "foo", format: "png"} instead of {name: "foo.png"}. (Florian Hanke)
* Add :status option support to send_file. (Konstantin Haase)
* The `provides` condition now respects an earlier set content type.
(Konstantin Haase)
* Exception#code is only used when :use_code is enabled. Moreover, it will
be ignored if the value is not between 400 and 599. You should use
Exception#http_status instead. (Konstantin Haase)
* Status, headers and body will be set correctly in an after filter when using
halt in a before filter or route. (Konstantin Haase)
* Sinatra::Base.new now returns a Sinatra::Wrapper instance, exposing
#settings and #helpers, yet going through the middleware stack on #call.
It also implements a nice #inspect, so it plays nice with Rails' `rake
routes`. (Konstantin Haase)
* In addition to WebRick, Thin and Mongrel, Sinatra will now automatically pick
up Puma, Trinidad, ControlTower or Net::HTTP::Server when installed. The
logic for picking the server has been improved and now depends on the Ruby
implementation used. (Mark Rada, Konstantin Haase, Patricio Mac Adden)
* "Sinatra doesn't know this ditty" pages now show the app class when running
a modular application. This helps detecting where the response came from when
combining multiple modular apps. (Konstantin Haase)
* When port is not set explicitly, use $PORT env variable if set and only
default to 4567 if not. Plays nice with foreman. (Konstantin Haase)
* Allow setting layout on a per engine basis. (Zachary Scott, Konstantin Haase)
* You can now use `register` directly in a classic app. (Konstantin Haase)
* `redirect` now accepts URI or Addressable::URI instances. (Nicolas
Sanguinetti)
* Have Content-Disposition header also include file name for `inline`, not
just for `attachment`. (Konstantin Haase)
* Better compatibility to Rack 1.5. (James Tucker, Konstantin Haase)
* Make route parsing regex more robust. (Zoltan Dezso, Konstantin Haase)
* Improve Accept header parsing, expose parameters. (Pieter van de Bruggen,
Konstantin Haase)
* Add `layout_options` render option. Allows you, amongst other things, to
render a layout from a different folder. (Konstantin Haase)
* Explicitly setting `layout` to `nil` is treated like setting it to `false`.
(richo)
* Properly escape attributes in Content-Type header. (Pieter van de Bruggen)
* Default to only serving localhost in development mode. (Postmodern)
* Setting status code to 404 in error handler no longer triggers not_found
handler. (Konstantin Haase)
* The `protection` option now takes a `session` key for force
disabling/enabling session based protections. (Konstantin Haase)
* Add `x_cascade` option to disable `X-Cascade` header on missing route.
(Konstantin Haase)
* Improve documentation. (Kashyap, Stanislav Chistenko, Zachary Scott,
Anthony Accomazzo, Peter Suschlik, Rachel Mehl, ymmtmsys, Anurag Priyam,
burningTyger, Tony Miller, akicho8, Vasily Polovnyov, Markus Prinz,
Alexey Muranov, Erik Johnson, Vipul A M, Konstantin Haase)
* Convert documentation to Markdown. (Kashyap, Robin Dupret, burningTyger,
Vasily Polovnyov, Iain Barnett, Giuseppe Capizzi, Neil West)
* Don't set not_found content type to HTML in development mode with custom
not_found handler. (Konstantin Haase)
* Fix mixed indentation for private methods. (Robin Dupret)
* Recalculate Content-Length even if hard coded if body is reset. Relevant
mostly for error handlers. (Nathan Esquenazi, Konstantin Haase)
* Plus sign is once again kept as such when used for URL matches. (Konstantin
Haase)
* Take views option into account for template caching. (Konstantin Haase)
* Consistent use of `headers` instead of `header` internally. (Patricio Mac Adden)
* Fix compatibility to RDoc 4. (Bohuslav Kabrda)
* Make chat example work with latest jQuery. (loveky, Tony Miller)
* Make tests run without warnings. (Patricio Mac Adden)
* Make sure value returned by `mime_type` is a String or nil, even when a
different object is passed in, like an AcceptEntry. (Konstantin Haase)
* Exceptions in `after` filter are now handled like any other exception.
(Nathan Esquenazi)
= 1.3.4 / 2012-01-26
* Improve documentation. (Kashyap, Stanislav Chistenko, Konstantin Haase,
ymmtmsys, Anurag Priyam)
* Adjustments to template system to work with Tilt edge. (Konstantin Haase)
* Fix streaming with latest Rack release. (Konstantin Haase)
* Fix default content type for Sinatra::Response with latest Rack release.
(Konstantin Haase)
* Fix regression where + was no longer treated like space. (Ross Boucher)
* Status, headers and body will be set correctly in an after filter when using
halt in a before filter or route. (Konstantin Haase)
= 1.3.3 / 2012-08-19
* Improved documentation. (burningTyger, Konstantin Haase, Gabriel Andretta,
Anurag Priyam, michelc)
* No longer modify the load path. (Konstantin Haase)
* When keeping a stream open, set up callback/errback correctly to deal with
clients closing the connection. (Konstantin Haase)
* Fix bug where having a query param and a URL param by the same name would
concatinate the two values. (Konstantin Haase)
* Prevent douplicated log output when application is already wrapped in a
`Rack::CommonLogger`. (Konstantin Haase)
* Fix issue where `Rack::Link` and Rails were preventing indefinite streaming.
(Konstantin Haase)
* No longer cause warnings when running Ruby with `-w`. (Konstantin Haase)
* HEAD requests on static files no longer report a Content-Length of 0, but
instead the proper length. (Konstantin Haase)
* When protecting against CSRF attacks, drop the session instead of refusing
the request. (Konstantin Haase)
= 1.3.2 / 2011-12-30
* Don't automatically add `Rack::CommonLogger` if `Rack::Server` is adding it,
too. (Konstantin Haase)
* Setting `logging` to `nil` will avoid setting up `Rack::NullLogger`.
(Konstantin Haase)
* Route specific params are now available in the block passed to #stream.
(Konstantin Haase)
* Fix bug where rendering a second template in the same request, after the
first one raised an exception, skipped the default layout. (Nathan Baum)
* Fix bug where parameter escaping got enabled when disabling a different
protection. (Konstantin Haase)
* Fix regression: Filters without a pattern may now again manipulate the params
hash. (Konstantin Haase)
* Added examples directory. (Konstantin Haase)
* Improved documentation. (Gabriel Andretta, Markus Prinz, Erick Zetta, Just
Lest, Adam Vaughan, Aleksander Dąbrowski)
* Improved MagLev support. (Tim Felgentreff)
= 1.3.1 / Not Yet Released
* Support adding more than one callback to the stream object. (Konstantin
Haase)
= 1.3.0 / 2011-09-30
* Added `stream` helper method for easily creating streaming APIs, Server
Sent Events or even WebSockets. See README for more on that topic.
(Konstantin Haase)
* If a HTTP 1.1 client is redirected from a different verb than GET, use 303
instead of 302 by default. You may still pass 302 explicitly. Fixes AJAX
redirects in Internet Explorer 9 (to be fair, everyone else is doing it
wrong and IE is behaving correct). (Konstantin Haase)
* Added support for HTTP PATCH requests. (Konstantin Haase)
* Use rack-protection to defend against common opportunistic attacks.
(Josh Lane, Jacob Burkhart, Konstantin Haase)
* Support for Creole templates, Creole is a standardized wiki markup,
supported by many wiki implementations. (Konstanin Haase)
* The `erubis` method has been deprecated. If Erubis is available, Sinatra
will automatically use it for rendering ERB templates. `require 'erb'`
explicitly to prevent that behavior. (Magnus Holm, Ryan Tomayko, Konstantin
Haase)
* Patterns now match against the escaped URLs rather than the unescaped
version. This makes Sinatra confirm with RFC 2396 section 2.2 and RFC 2616
section 3.2.3 (escaped reserved characters should not be treated like the
unescaped version), meaning that "/:name" will also match `/foo%2Fbar`, but
not `/foo/bar`. To avoid incompatibility, pattern matching has been
adjusted. Moreover, since we do no longer need to keep an unescaped version
of path_info around, we handle all changes to `env['PATH_INFO']` correctly.
(Konstantin Haase)
* `settings.app_file` now defaults to the file subclassing `Sinatra::Base` in
modular applications. (Konstantin Haase)
* Set up `Rack::Logger` or `Rack::NullLogger` depending on whether logging
was enabled or not. Also, expose that logger with the `logger` helper
method. (Konstantin Haase)
* The sessions setting may be an options hash now. (Konstantin Haase)
* Important: Ruby 1.8.6 support has been dropped. This version also depends
on at least Rack 1.3.0. This means that it is incompatible with Rails prior
to 3.1.0. Please use 1.2.x if you require an earlier version of Ruby or
Rack, which we will continue to supply with bug fixes. (Konstantin Haase)
* Renamed `:public` to `:public_folder` to avoid overriding Ruby's built-in
`public` method/keyword. `set(:public, ...)` is still possible but shows a
warning. (Konstantin Haase)
* It is now possible to use a different target class for the top level DSL
(aka classic style) than `Sinatra::Application` by setting
`Delegator.target`. This was mainly introduced to ease testing. (Konstantin
Haase)
* Error handlers defined for an error class will now also handle subclasses
of that class, unless more specific error handlers exist. (Konstantin
Haase)
* Error handling respects Exception#code, again. (Konstantin Haase)
* Changing a setting will merge hashes: `set(:x, :a => 1); set(:x :b => 2)`
will result in `{:a => 1, :b => 2}`. Use `set(:x, {:a => 1}, true)` to
avoid this behavior. (Konstantin Haase)
* Added `request.accept?` and `request.preferred_type` to ease dealing with
`Accept` headers. (Konstantin Haase)
* Added `:static_cache_control` setting to automatically set cache control
headers to static files. (Kenichi Nakamura)
* Added `informal?`, `success?`, `redirect?`, `client_error?`,
`server_error?` and `not_found?` helper methods to ease dealing with status
codes. (Konstantin Haase)
* Uses SecureRandom to generate default session secret. (Konstantin Haase)
* The `attachment` helper will set Content-Type (if it hasn't been set yet)
depending on the supplied file name. (Vasiliy Ermolovich)
* Conditional requests on `etag` helper now work properly for unsafe HTTP
methods. (Matthew Schinckel, Konstantin Haase)
* The `last_modified` helper does not stop execution and change the status code
if the status code is something different than 200. (Konstantin Haase)
* Added support for If-Unmodified-Since header. (Konstantin Haase)
* `Sinatra::Base.run!` now prints to stderr rather than stdout. (Andrew
Armenia)
* `Sinatra::Base.run!` takes a block allowing access to the Rack handler.
(David Waite)
* Automatic `app_file` detection now works in directories containing brackets
(Konstantin Haase)
* Exception objects are now passed to error handlers. (Konstantin Haase)
* Improved documentation. (Emanuele Vicentini, Peter Higgins, Takanori
Ishikawa, Konstantin Haase)
* Also specify charset in Content-Type header for JSON. (Konstantin Haase)
* Rack handler names will not be converted to lower case internally, this
allows you to run Sinatra with custom Rack handlers, like Kirk or Mongrel2.
Example: `ruby app.rb -s Mongrel2` (Konstantin Haase)
* Ignore `to_ary` on response bodies. Fixes compatibility to Rails 3.1.
(Konstantin Haase)
* Middleware setup is now distributed across multiple methods, allowing
Sinatra extensions to easily hook into the setup process. (Konstantin
Haase)
* Internal refactoring and minor performance improvements. (Konstantin Haase)
* Move Sinatra::VERSION to separate file, so it can be checked without
loading Sinatra. (Konstantin Haase)
* Command line options now complain if value passed to `-p` is not a valid
integer. (Konstantin Haase)
* Fix handling of broken query params when displaying exceptions. (Luke
Jahnke)
= 1.2.7 (backports release) / Not Yet Released
Custom changes:
* Fix Ruby 1.8.6 issue with Accept header parsing. (Konstantin Haase)
Backported from 1.3.0:
* Ignore `to_ary` on response bodies. Fixes compatibility to Rails 3.1.
(Konstantin Haase)
* `Sinatra.run!` now prints to stderr rather than stdout. (Andrew Armenia)
* Automatic `app_file` detection now works in directories containing brackets
(Konstantin Haase)
* Improved documentation. (Emanuele Vicentini, Peter Higgins, Takanori
Ishikawa, Konstantin Haase)
* Also specify charset in Content-Type header for JSON. (Konstantin Haase)
* Rack handler names will not be converted to lower case internally, this
allows you to run Sinatra with custom Rack handlers, like Kirk or Mongrel2.
Example: `ruby app.rb -s Mongrel2` (Konstantin Haase)
* Fix uninitialized instance variable warning. (David Kellum)
* Command line options now complain if value passed to `-p` is not a valid
integer. (Konstantin Haase)
* Fix handling of broken query params when displaying exceptions. (Luke
Jahnke)