Sha256: 074fc5f8faa2332c6d7797a52b7fb743e4ec6ecf4d2bacd3c0de293b05ba6e26

Contents?: true

Size: 425 Bytes

Versions: 4

Compression:

Stored size: 425 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]}",
      :config_file => options[:config_file])

    yield(server) if block_given?

    server.start.join
  end
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rack-handlers-0.5.5 lib/rack/handler/unicorn.rb
rack-handlers-0.5.4 lib/rack/handler/unicorn.rb
rack-handlers-0.5.3 lib/rack/handler/unicorn.rb
rack-handlers-0.5.2 lib/rack/handler/unicorn.rb