Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # requiring 'sinatra' brings in 'sinatra/base' and 'sinatra/main', which
- # triggers the top-level hackery. Also required is 'sinatra/compat', which
- # includes support for things I propose we deprecate.
- require 'sinatra'
- enable :sessions # Sinatra::Application.enable :sessions
- set :foo, 'bar' # Sinatra::Application.set :foo, 'bar'
- configure :production do # Sinatra::Application.configure :production
- ...
- end
- helpers do # class Sinatra::Application
- def blink(text)
- "<blink>#{text}</blink>"
- end
- end
- get '/foo/:who' do # Sinatra::Application.get '/foo/:who'
- ...
- end
- # Sinatra::Application is the "default application"; all top-level calls are
- # delegated there.
Add Comment
Please, Sign In to add comment