Sha256: 2de0f3f21f17830c0e84e981d0d76718e35cbc281eac12c7254332932037bede

Contents?: true

Size: 378 Bytes

Versions: 2

Compression:

Stored size: 378 Bytes

Contents

require 'unicorn'
require 'rack/handler'

class Rack::Handler::Unicorn
  def self.server_class
    ::Unicorn::HttpServer
  end

  def self.run app, options
    server = server_class.new(app,
      :listeners => "#{options[:Host]}:#{options[:Port]}")

    yield(server) if block_given?

    server.start.join
  end
end

Rack::Handler.register('unicorn', Rack::Handler::Unicorn)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-handlers-0.5.1 lib/rack/handler/unicorn.rb
rack-handlers-0.5.0 lib/rack/handler/unicorn.rb