Class: Kawaii::SingletonApp
Overview
Class used to implement a standalone Kawaii app generated with top-level route helpers (e.g. monkey-patched onto the `main` object).
This lets you create a .rb file containing just route definitions and run it with `ruby` command.
Constant Summary
Constants included from ServerMethods
Kawaii::ServerMethods::WEBRICK
Class Method Summary (collapse)
Methods inherited from Base
Methods included from RoutingMethods
add_http_method, #context, #delete, #get, #head, #link, #match, #methods_used, #options, #patch, #post, #put, #route, #trace, #unlink
Methods included from ServerMethods
Constructor Details
This class inherits a constructor from Kawaii::Base
Class Method Details
+ (Object) maybe_start!(port)
21 22 23 24 |
# File 'lib/kawaii/singleton_app.rb', line 21 def maybe_start!(port) # Give routes a chance to install and app to initialize. at_exit { start!(port) unless $ERROR_INFO } if !running? && run_direct? end |