Created
January 22, 2009 17:30
-
-
Save jnewland/50625 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
# A Sinatra App as a Rails Plugin | |
# | |
# In your Edge Rails app: | |
# | |
# ruby script/plugin install git://gist.github.com/50625.git | |
require 'sinatra/base' | |
class SinatraRailsPlugin < Sinatra::Base | |
get '/foo' do | |
'bar' | |
end | |
#this hackeration is required for sinatra to be a nice rack citizen | |
error 404 do | |
@app.call(env) | |
end | |
end | |
config.after_initialize do | |
config.gem 'sinatra' | |
config.middleware.use SinatraRailsPlugin | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment