Module: Sinatra

Module | Sinatra
In: | lib/sinatra/base.rb lib/sinatra/compat.rb lib/sinatra/main.rb lib/sinatra/showexceptions.rb lib/sinatra/test.rb

### Methods

application application= build_application env helpers host new options port register

### Classes and Modules

Module Sinatra::Helpers
Module Sinatra::Templates
Module Sinatra::Test
Class Sinatra::Application
Class Sinatra::Base
Class Sinatra::Default
Class Sinatra::Request
Class Sinatra::Response
Class Sinatra::ServerError
Class Sinatra::ShowExceptions
Class Sinatra::TestHarness

### Constants

VERSION | = | '0.9.4'

### Public Class methods

application()

Deprecated. Use: Sinatra::Application

[Source]

         # File lib/sinatra/compat.rb, line 226
    226:     def application
    227:       sinatra_warn "Sinatra.application is deprecated; use Sinatra::Application instead."
    228:       Sinatra::Application
    229:     end

application=(value)

Deprecated. Use: Sinatra::Application.reset!

[Source]

         # File lib/sinatra/compat.rb, line 232
    232:     def application=(value)
    233:       raise ArgumentError unless value.nil?
    234:       sinatra_warn "Setting Sinatra.application to nil is deprecated; create a new instance instead."
    235:       Sinatra.class_eval do
    236:         remove_const :Application
    237:         const_set :Application, Class.new(Sinatra::Default)
    238:       end
    239:     end

build_application()

[Source]

         # File lib/sinatra/compat.rb, line 241
    241:     def build_application
    242:       sinatra_warn "Sinatra.build_application is deprecated; use Sinatra::Application instead."
    243:       Sinatra::Application
    244:     end

env()

[Source]

         # File lib/sinatra/compat.rb, line 261
    261:     def env
    262:       sinatra_warn "Sinatra.env is deprecated; use Sinatra::Application.environment instead."
    263:       options.environment
    264:     end

helpers(*extensions, &block)

Include the helper modules provided in Sinatra‘s request context.

[Source]

          # File lib/sinatra/base.rb, line 1108
    1108:   def self.helpers(*extensions, &block)
    1109:     Default.helpers(*extensions, &block)
    1110:   end

host()

[Source]

         # File lib/sinatra/compat.rb, line 256
    256:     def host
    257:       sinatra_warn "Sinatra.host is deprecated; use Sinatra::Application.host instead."
    258:       options.host
    259:     end

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

Create a new Sinatra application. The block is evaluated in the new app‘s class scope.

[Source]

          # File lib/sinatra/base.rb, line 1096
    1096:   def self.new(base=Base, options={}, &block)
    1097:     base = Class.new(base)
    1098:     base.send :class_eval, &block if block_given?
    1099:     base
    1100:   end

options()

[Source]

         # File lib/sinatra/compat.rb, line 246
    246:     def options
    247:       sinatra_warn "Sinatra.options is deprecated; use Sinatra::Application.option_name instead."
    248:       Sinatra::Application.options
    249:     end

port()

[Source]

         # File lib/sinatra/compat.rb, line 251
    251:     def port
    252:       sinatra_warn "Sinatra.port is deprecated; use Sinatra::Application.port instead."
    253:       options.port
    254:     end

register(*extensions, &block)

Extend the top-level DSL with the modules provided.

[Source]

          # File lib/sinatra/base.rb, line 1103
    1103:   def self.register(*extensions, &block)
    1104:     Default.register(*extensions, &block)
    1105:   end

[Validate]