Created
June 19, 2010 19:05
-
-
Save paul/445179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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