1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
Commit graph

16 commits

Author SHA1 Message Date
Ryan Tomayko
c4843a0803 Fix mocha puking all over itself under 1.9 2009-05-18 03:49:10 -07:00
Simon Rozet
7030e25066 Deprecation warning for auto-require of template engines 2009-05-18 02:47:36 -07:00
S. Brent Faulkner
cfdf97d495 template backtraces ftw [#198] [#51] 2009-04-25 05:16:14 -07:00
Blake Mizerany
801163e9f3 closes #9779 Auto-require haml/erb/builder/sass
this is causing thread-saftey issues.
2009-04-24 17:59:39 -07:00
Ryan Tomayko
49adaa5362 Sane template options [#191]
* The options hash now takes the :views, :layout, and :locals
  options but also any template-specific options. The generic
  options are removed before calling the template specific render
  method.

* The haml ":options" and ":haml" options are deprecated. These
  should be merged in directly with the options hash.

* The sass ":sass" option is deprecated. Merge directly with the
  options hash instead.

* All template engines have an app-level option named the same as
  their engine (erb, haml, sass, etc.). This must be a hash and is
  merged with the options passed to the render method.

* The :views_directory option is deprecated; renamed :views.
2009-03-31 01:58:47 -07:00
Ryan Tomayko
08b142b4cc Never use Session middleware in test environment [#119] 2009-02-26 22:48:46 -08:00
Ryan Tomayko
9460520723 Remove disabled compat specs 2009-02-23 08:47:22 -08:00
Ryan Tomayko
a9e9f00240 Add send_data back in but deprecate [#143] 2009-02-22 01:03:57 -08:00
Ryan Tomayko
f497f4f36f Don't assume method lists are Strings in 1.9
Object.private_instance_methods and Object.private_methods
return Arrays of Symbols in 1.9.
2009-02-02 18:49:12 -08:00
Ryan Tomayko
25b045625c Fix failing compat test due to Delegator changes
Also, run compat tests with the default rake task.
2009-01-25 21:38:41 -08:00
Ryan Tomayko
877bfb379c Fix send_file :disposition compat issues [#128] 2009-01-24 21:31:45 -08:00
Ryan Tomayko
90581dccb7 Add deprecated Sinatra::EventContext to unbreak plugins 2009-01-24 21:29:44 -08:00
Ryan Tomayko
c00a25ee41 Test framework refactoring
* Adds test/helper.rb and moves mock_app and other code specific
  to testing the framework out of Sinatra::Test.
* Do not require test/unit. The sinatra/test/unit,
  sinatra/test/spec, and sinatra/test/rspec files can be used to
  choose the framework.
* Add Sinatra::TestHarness, which should act similar to the
  Rack::Session proposal here: http://gist.github.com/41270
* Update the README with information on using the different test
  frameworks.
2009-01-14 07:52:04 -08:00
Ryan Tomayko
f41472f882 Deprecation warnings for 0.3.x compat features (#52)
While here, remove deprecation of the not_found class method
for registering a 404 error page.
2009-01-10 21:56:04 -08:00
Ryan Tomayko
1c124f5d44 unbreak send_file compat specs; add media_type helper 2008-12-22 03:12:09 -08:00
Ryan Tomayko
a734cf38ac I knew I shoulda taken that left turn at Hoboken
This is a fairly large reworking of Sinatra's innards. Although
most of the internal implementation has been modified, it
provides the same basic feature set and is meant to be compatible
with Sinatra 0.3.2.

* The Event and EventContext classes have been removed. Sinatra
  applications are now defined within the class context of a
  Sinatra::Base subclass; each request is processed within a new
  instance.

* Sinatra::Base can be used as a base class for multiple
  Rack applications within a single process and can be used as
  Rack middleware.

* The routing and result type processing implementation has been
  simplified and enhanced a bit. There's a new route conditions
  system for things like :agent/:host matching and a request
  level #pass method has been added to allow an event handler to
  exit immediately, passing control to the next matching route.

* Regular expressions may now be used in route patterns. Captures
  are available as an array from "params[:captures]".

* The #body helper method now takes a block. The block is not
  evaluated until an attempt is made to read the body.

* Options are now dynamically generated class attributes on the
  Sinatra::Base subclass (instead of OpenStruct); options are
  inherited by subclasses and may be overridden up the
  inheritance hierarchy. The Base.set manages all option related
  stuff.

* The application file (app_file) detection heuristics are bit
  more sane now. This fixes some bugs with reloading and
  public/views directory detection. All thin / passenger issues
  of these type should be better now.

* Error mappings are now split into to distinct layers: exception
  mappings and custom error pages. Exception mappings are registered
  with 'error(Exception)' and are run only when the app raises an
  exception. Custom error pages are registered with error(status_code)
  and are run any time the response has the status code specified.
  It's also possible to register an error page for a range of status
  codes: 'error(500..599)'.

* The spec and unit testing extensions have been modified to take
  advantage of the ability to have multiple Sinatra applications.
  The Sinatra::Test module must be included within the TestCase
  in order to take advantage of these methods (unless the
  'sinatra/compat' library has been required).

* Rebuilt specs from scratch for better coverage and
  organization. Sinatra 3.2 unit tests have been retained
  under ./compat to ensure a baseline level of compatibility with
  previous versions; use the 'rake compat' task to run these.

A large number of existing Sinatra idioms have been deprecated but
continue to be supported through the 'sinatra/compat' library.

* The "set_option" and "set_options" methods have been deprecated
  due to redundancy; use "set".

* The "env" option (Sinatra::Base.env) has been renamed to "environment"
  and deprecated because it's too easy to confuse with the request-level
  Rack environment Hash (Sinatra::Base#env).

* The request level "stop" method has been renamed "halt" and
  deprecated. This is for consistency with `throw :halt`.

* The request level "entity_tag" method has been renamed "etag" and
  deprecated. Both versions were previously supported.

* The request level "headers" method has been deprecated. Use
  response['Header-Name'] to access and modify response headers.

* Sinatra.application is deprecated. Use Sinatra::Application instead.

* Setting Sinatra.application = nil to reset an application is
  deprecated. You shouldn't have to reset objects anymore.

* The Sinatra.default_options Hash is deprecated. Modifying this object now
  results in "set(key, value)" invocations on the Sinatra::Base
  subclass.

* The "body.to_result" convention has been deprecated.

* The ServerError exception has been deprecated. Any Exception is now
  considered a ServerError.
2008-12-20 18:45:28 -08:00