def run(options, arguments)
require 'rack'
@base.require_site
options_for_rack = {
:Port => (options[:port] || 3000).to_i,
:Host => (options[:host] || '0.0.0.0')
}
unless handler = Rack::Handler.get(options[:handler])
begin
handler = Rack::Handler::Mongrel
rescue LoadError => e
handler = Rack::Handler::WEBrick
end
end
autocompiler = Nanoc3::Extra::AutoCompiler.new('.')
app = Rack::Builder.new do
use Rack::CommonLogger, $stderr
use Rack::ShowExceptions
run autocompiler
end.to_app
puts "Running on http://#{options_for_rack[:Host]}:#{options_for_rack[:Port]}/"
handler.run(app, options_for_rack)
end