Class: Rack::Handler::Thin

Inherits:
Object
  • Object
show all
Defined in:
rack/rack/handler/thin.rb

Class Method Summary (collapse)

Class Method Details

+ (void) run(app, options = {}) {|server| ... }

Yields:

  • (server)


8
9
10
11
12
13
14
15
16
17
# File 'rack/rack/handler/thin.rb', line 8

def self.run(app, options={})
  host = options.delete(:Host) || '0.0.0.0'
  port = options.delete(:Port) || 8080
  args = [host, port, app, options]
  # Thin versions below 0.8.0 do not support additional options
  args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8
  server = ::Thin::Server.new(*args)
  yield server if block_given?
  server.start
end

+ (void) valid_options



19
20
21
22
23
24
# File 'rack/rack/handler/thin.rb', line 19

def self.valid_options
  {
    "Host=HOST" => "Hostname to listen on (default: localhost)",
    "Port=PORT" => "Port to listen on (default: 8080)",
  }
end