Skip to content

Instantly share code, notes, and snippets.

@paul
Created June 19, 2010 19:05
Show Gist options
  • Select an option

  • Save paul/445179 to your computer and use it in GitHub Desktop.

Select an option

Save paul/445179 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'bundler'
Bundler.setup
require 'active_support/core_ext/class/subclasses'
require 'sinatra/base'
module Keister
class App < Sinatra::Base
# settings
end
end
app_dir = File.expand_path(File.join(File.dirname(__FILE__), 'app'))
Dir[File.join(app_dir, 'controllers', '*.rb')].each do |controller|
require controller
end
module Keister
def self.app
@app || Rack::Builder.new do
Keister::App.descendents.each do |subapp|
use subapp
end
run Keister::App
end
end
end
class Keister::MyController < Keister::App
get '/' do
'Hello, world!'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment