Skip to content

Instantly share code, notes, and snippets.

@bernd
Created May 3, 2011 10:17
Show Gist options
  • Save bernd/953111 to your computer and use it in GitHub Desktop.
Save bernd/953111 to your computer and use it in GitHub Desktop.
Trying a modular sinatra app
require 'sinatra/base'
require 'post'
class App < Sinatra::Base
include Post
end
require 'rubygems'
$LOAD_PATH.unshift File.dirname(__FILE__)
require 'app'
run App
module Post
def self.included(base)
base.class_eval do
post '/post' do
content_type :text
"POST\n"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment