Class: Miron::Handler::Thin::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/miron/handlers/thin.rb

Instance Method Summary collapse

Constructor Details

#initialize(mironfile, options) ⇒ Proxy

Returns a new instance of Proxy


36
37
38
39
40
# File 'lib/miron/handlers/thin.rb', line 36

def initialize(mironfile, options)
  @mironfile = mironfile
  @options = options
  listen(@options['host'], @options['port'].to_i)
end

Instance Method Details

#listen(address, port) {|server| ... } ⇒ Object

Yields:

  • (server)

42
43
44
45
46
47
48
49
# File 'lib/miron/handlers/thin.rb', line 42

def listen(address, port)
  args = [address, port, nil]
  # Thin versions below 0.8.0 do not support additional options
  args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8
  server = ::Miron::Handler::Thin.new(@mironfile, *args)
  yield server if block_given?
  server.start
end