Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Webmachine and Shotgun

View Rakefile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
task :shotgun do
require "rack"
require "shotgun"
 
class Shotgun::Loader
# assemble_app gets called inside the request worker
# after forking, so your_app will be loaded freshly
# for each request.
def assemble_app
require "webmachine/adapters/rack"
require "your_app"
Webmachine::Adapters::Rack.new(YourApp.new.application)
end
end
 
app = Rack::Builder.new do
use Shotgun::SkipFavicon
run Shotgun::Loader.allocate
end
 
%w{INT TERM QUIT}.each {|signal| trap(signal) { exit! } }
 
options = {:Host => "127.0.0.1", :Port => 3000}
Rack::Handler.get(:webrick).run(app, options)
end

https://gist.github.com/lgierth/4389220#file-rakefile-L12 should be:

Webmachine::Adapters::Rack.new(YourApp.new.application)
Owner

Thanks, updated it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.