2016-02-07 01:28:02 -05:00
|
|
|
require 'puma/launcher'
|
|
|
|
require 'puma/configuration'
|
|
|
|
|
|
|
|
module Puma
|
|
|
|
def self.run(opts={})
|
2017-03-03 16:11:59 -05:00
|
|
|
cfg = Puma::Configuration.new do |user_config|
|
2016-02-07 01:28:02 -05:00
|
|
|
if port = opts[:port]
|
2017-03-03 16:11:59 -05:00
|
|
|
user_config.port port
|
2016-02-07 01:28:02 -05:00
|
|
|
end
|
|
|
|
|
2017-03-03 16:11:59 -05:00
|
|
|
user_config.quiet
|
2016-02-07 01:28:02 -05:00
|
|
|
|
|
|
|
yield c
|
|
|
|
end
|
|
|
|
|
|
|
|
cfg.clamp
|
|
|
|
|
2016-02-07 17:51:54 -05:00
|
|
|
events = Puma::Events.null
|
2016-02-07 01:28:02 -05:00
|
|
|
|
|
|
|
launcher = Puma::Launcher.new cfg, :events => events
|
|
|
|
launcher.run
|
|
|
|
end
|
|
|
|
end
|