Commit Graph

2 Commits

Author SHA1 Message Date
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