Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update CHANGES with new features and obsoletions

  • Loading branch information...
commit e14c700b1814540fb70702cead90e222eedfd6a8 1 parent 973831e
@rtomayko rtomayko authored
Showing with 73 additions and 1 deletion.
  1. +73 −1 CHANGES
View
74 CHANGES
@@ -1,9 +1,18 @@
= 1.0 / unreleased
+ * 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.
+
* 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
- markaby and liquid.
+ mustache and liquid.
+
+ * New 'settings' method gives access to options in both class and request
+ scopes. This replaces the 'options' method.
+
+ * New 'erubis' helper method for rendering Erubis templates.
* New 'expires' helper method is like cache_control but takes an
integer number of seconds or Time object:
@@ -15,6 +24,9 @@
this:
cache_control :public, :must_revalidate, :max_age => 60
+ * Sinatra apps can now be run with a `-h <addr>` argument to specify
+ the address to bind to.
+
* Rack::Session::Cookie is now added to the middleware pipeline when
running in test environments if the :sessions option is set.
@@ -25,6 +37,66 @@
of issues with extensions that need to add any of these things
to the base class.
+The following Sinatra features have been obsoleted 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](http://gitrdoc.com/brynary/rack-test) 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.
+
+ * 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.
@mislav
mislav added a note

huh? what does that mean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ Template engine options should be passed in the second Hash argument
+ instead.
+
+ * The 'media_type' helper 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](http://www.sinatrarb.com/extensions.html)
+ 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.
+
= 0.9.2 / 2009-05-18
* This version is compatible with Rack 1.0. [Rein Henrichs]

6 comments on commit e14c700

@mislav

huh? what does that mean

@rtomayko

The sass and haml methods used to take :sass and :haml options for passing options to the template engine. e.g.,

get '/' do
  haml :foo, :haml => { :format => :html5, :encoding => 'ascii' }, :layout => :bar
end

Now, template engine specific options are passed in the main options hash, like:

get '/' do
  haml :foo, :format => :html5, :encoding => 'ascii', :layout => :bar
end

It would probably be worth adding an example like this to CHANGES.

@rkh
Owner

Can I still do "set :haml, :format => ..."?

@rtomayko

rkh: Oh yeah. Even better, that idiom has been extended to all template engines. So you can do stuff like:

set :erb, :trim => '<>'
set :mustache, :namespace => Foo::Bar
set :erubis, ...

The bullet about :haml and :sass hash options going away applies only to passing those options to render methods. I'll try to make this more explicit.

@rtomayko

Also, it's worth noting that there's deprecation warnings in the current stable 0.9.x release for all obsoleted features noted above. If you can run under the current release without warnings, you should be fine under Sinatra 1.0.

@rkh
Owner

Nice.

@Aupajo

I like it!

Please sign in to comment.
Something went wrong with that request. Please try again.