Module: Padrino::Cli::Adapter
- Defined in:
- lib/padrino-core/cli/adapter.rb
Class Method Summary collapse
-
.start(options) ⇒ Object
Start for the given options a rackup handler.
-
.stop(options) ⇒ Object
Method that stop (if exist) a running Padrino.application.
Class Method Details
.start(options) ⇒ Object
Start for the given options a rackup handler
8 9 10 |
# File 'lib/padrino-core/cli/adapter.rb', line 8 def start() Padrino.run!(Utils.symbolize_keys()) end |
.stop(options) ⇒ Object
Method that stop (if exist) a running Padrino.application
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/padrino-core/cli/adapter.rb', line 13 def stop() = Utils.symbolize_keys() if File.exist?([:pid]) pid = File.read([:pid]).to_i puts "=> Sending INT to process with pid #{pid}" begin Process.kill(2, pid) rescue Errno::ESRCH, RangeError => error puts error. exit rescue Errno::EPERM => error puts error. abort end else puts "=> #{[:pid]} not found!" abort end end |