middleman/middleman-core/lib/vendored-middleman-deps/padrino-core-0.12.0/lib/padrino-core/cli/adapter.rb
2014-02-18 18:30:29 -08:00

25 lines
656 B
Ruby

module Padrino
module Cli
module Adapter
class << self
# Start for the given options a rackup handler
def start(options)
Padrino.run!(options.symbolize_keys)
end
# Method that stop (if exist) a running Padrino.application
def stop(options)
options.symbolize_keys!
if File.exist?(options[:pid])
pid = File.read(options[:pid]).to_i
print "=> Sending INT to process with pid #{pid} wait "
Process.kill(2, pid) rescue nil
else
puts "=> #{options[:pid]} not found!"
end
end
end
end
end
end