Created
August 24, 2009 20:55
-
-
Save cschneid/174172 to your computer and use it in GitHub Desktop.
This file contains 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 'sinatra/base' | |
module Sinatra | |
module BeforeTest | |
def self.registered(app) | |
app.before do | |
file_scoped do | |
require_login! # or whatever. | |
end | |
end | |
app.get '/whatever' do | |
"whatever requires a login to get here" | |
end | |
end | |
end | |
register BeforeTest | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment