Create a gist now

Instantly share code, notes, and snippets.

@lgierth /Rakefile
Last active Dec 10, 2015

What would you like to do?
Webmachine and Shotgun
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"
app = do
use Shotgun::SkipFavicon
run Shotgun::Loader.allocate
%w{INT TERM QUIT}.each {|signal| trap(signal) { exit! } }
options = {:Host => "", :Port => 3000}
Rack::Handler.get(:webrick).run(app, options)

Asmod4n commented Oct 9, 2014 should be:

lgierth commented Oct 14, 2014

Thanks, updated it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment