Class: Rack::Handler::Plum
- Inherits:
-
Object
- Object
- Rack::Handler::Plum
- Defined in:
- lib/rack/handler/plum.rb
Class Method Summary collapse
Class Method Details
.run(app, options = {}) {|@server| ... } ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rack/handler/plum.rb', line 7 def self.run(app, = {}) opts = .merge() config = ::Plum::Rack::Config.new( listeners: [ { listener: ::Plum::Rack::TLSListener, hostname: opts[:Host], port: opts[:Port].to_i } ], debug: !!opts[:Debug] ) @server = ::Plum::Rack::Server.new(app, config) yield @server if block_given? # TODO @server.start end |
.shutdown ⇒ Object
26 27 28 |
# File 'lib/rack/handler/plum.rb', line 26 def self.shutdown @server.stop if @server end |
.valid_options ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/rack/handler/plum.rb', line 30 def self. { "Host=HOST" => "Hostname to listen on (default: #{[:Host]})", "Port=PORT" => "Port to listen on (default: #{[:Port]})", "Debug" => "Turn on debug mode (default: #{[:Debug]})", } end |