module Sinatra

def self.const_missing(const_name) #:nodoc:

:nodoc:
Make Sinatra::EventContext an alias for Sinatra::Application to unbreak plugins.
def self.const_missing(const_name) #:nodoc:
  if const_name == :EventContext
    const_set :EventContext, Sinatra::Application
    sinatra_warn 'Sinatra::EventContext is deprecated; use Sinatra::Application instead.'
    Sinatra::Application
  else
    super
  end
end

def self.helpers(*extensions, &block)

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

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

class scope.
Create a new Sinatra application. The block is evaluated in the new app's
def self.new(base=Base, options={}, &block)
  base = Class.new(base)
  base.send :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)
  Application.register(*extensions, &block)
end

def application

Deprecated. Use: Sinatra::Application
def application
  sinatra_warn "Sinatra.application is deprecated; use Sinatra::Application instead."
  Sinatra::Application
end

def application=(value)

Deprecated. Use: Sinatra::Application.reset!
def application=(value)
  raise ArgumentError unless value.nil?
  sinatra_warn "Setting Sinatra.application to nil is deprecated; create a new instance instead."
  Sinatra.class_eval do
    remove_const :Application
    const_set :Application, Class.new(Sinatra::Default)
  end
end

def build_application

def build_application
  sinatra_warn "Sinatra.build_application is deprecated; use Sinatra::Application instead."
  Sinatra::Application
end

def env

def env
  sinatra_warn "Sinatra.env is deprecated; use Sinatra::Application.environment instead."
  options.environment
end

def host

def host
  sinatra_warn "Sinatra.host is deprecated; use Sinatra::Application.host instead."
  options.host
end

def options

def options
  sinatra_warn "Sinatra.options is deprecated; use Sinatra::Application.option_name instead."
  Sinatra::Application.options
end

def port

def port
  sinatra_warn "Sinatra.port is deprecated; use Sinatra::Application.port instead."
  options.port
end