Sha256: 81aae211630ad701d9dca9d777133d23bf5a49a221d6b8ed60718a0089355fd1

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

require "rack"

module Nutcracker
  module Web
    def self.start(nutcracker, options = {})
      @thread = Thread.new do
        Thread.current.abort_on_exception=true
        Rack::Server.start(
          {
            :app => App.new(nutcracker),
            :environment => 'production',
            :pid => nil,
            :Port => 9292,
            :Host => '0.0.0.0',
            :AccessLog => []
          }.merge( options )
        )
      end
      self
    end
    
    def self.stop
      @thread.kill
    end

    autoload :App, 'nutcracker/web/app'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nutcracker-web-0.0.4 lib/nutcracker/web.rb
nutcracker-web-0.0.3 lib/nutcracker/web.rb