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

7 commits

Author SHA1 Message Date
Simon Rozet
af1ee6ae94 Get rid of Default
TODO: clean the options^Wsettings test
2009-10-18 01:18:53 +02:00
Simon Rozet
ff0d068687 Use contest instead of test/spec/mini
See <http://github.com/citrusbyte/contest> for more info. The
contest.rb file is included under the test/ directory.
2009-03-31 02:23:48 -07:00
Pat Nakajima
c9b2f6b74c Fixed extension method delegation [#172] 2009-03-16 09:15:45 -07:00
Ryan Tomayko
eba6de6970 Add registered callback for extension modules [#148]
The "registered" message is sent to extension modules immediately
after the module is mixed into a Sinatra::Base class. This can be
used to initialize the class with options, add templates, define
error handlers, etc.
2009-02-23 22:09:02 -08:00
Ryan Tomayko
b5d4a5e636 Fix failing spec under 1.8.6 due to lack of Symbol#to_proc 2009-02-03 16:02:41 -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
Nicolas Sanguinetti
57183bc004 Added Sinatra.register and Sinatra.helpers
Sinatra.register:

* This will extend the DSL in Sinatra::Default (and subclasses) with
  the modules passed.

* All public methods in the extensions are added to Sinatra::Delegator
  when extending Sinatra::Default or it's subclasses.

* Sinatra::Base.register is available to add extensions to arbitrary
  classes (but they don't add methods to Delegator).

* You can pass a block with extensions which will get added as an
  anonymous block (same semantics of Sinatra::Base.helpers)

Sinatra.helpers:

* Will forward the modules passed to Default.helpers.

* Small change in semantics: passing a block to helpers will no longer
  class_eval the block, but will instead turn it into an anonymous
  module. This pushes it into the inheritance chain "normally" and
  allows us to call super to reach the original method if redefined.
2009-01-30 13:23:33 -08:00