Module: Rack::Handler::Soba
- Defined in:
- lib/rack/handler/soba.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :debug => false, }
Class Method Summary collapse
Class Method Details
.run(app, options = {}) {|server| ... } ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rack/handler/soba.rb', line 12 def self.run(app, = {}) = DEFAULT_OPTIONS.merge() host, port = [:Host], [:Port] server = ::Soba::Server.new(app, host: host, port: port, **) yield server if block_given? begin server.run rescue Interrupt puts "* Stopping..." # server.stop puts "* Cool!" end end |
.valid_options ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/rack/handler/soba.rb', line 29 def self. { "Host=HOST" => "Hostname to listen on (default: localhost)", "Port=PORT" => "Port to listen on (default: 8080)", "debug=false" => "Enable debug output (default: false)", } end |