module Sinatra

def self.helpers(*extensions, &block)

Include the helper modules provided in Sinatra's request context.
def self.helpers(*extensions, &block)
  Delegator.target.helpers(*extensions, &block)
end

def self.new(base = Base, &block)

Create a new Sinatra application; the block is evaluated in the class scope.
def self.new(base = Base, &block)
  base = Class.new(base)
  base.class_eval(&block) if block_given?
  base
end

def self.register(*extensions, &block)

Extend the top-level DSL with the modules provided.
def self.register(*extensions, &block)
  Delegator.target.register(*extensions, &block)
end

def self.use(*args, &block)

Use the middleware for classic applications.
def self.use(*args, &block)
  Delegator.target.use(*args, &block)
end