Sha256: a23349747e493fa7648af78aa7be116602f71fb37708fd0891ffa99a610b00dd
Contents?: true
Size: 977 Bytes
Versions: 8
Compression:
Stored size: 977 Bytes
Contents
module Soaring class Runner def initialize(options) @options = options end def run Dir.chdir(@options[:project_root]) do if @options[:autorestart] run_repeatedly else run_once end end end private def run_repeatedly while true do $stderr.puts "starting rackup repeatedly with parameters #{compile_rackup_parameters}" if @options[:verbose] response, exit_status = Executor::execute("bundle exec rackup #{compile_rackup_parameters}") sleep(0.5) end end def run_once $stderr.puts "starting rackup once with parameters #{compile_rackup_parameters}" if @options[:verbose] exec("bundle exec rackup #{compile_rackup_parameters}") end def compile_rackup_parameters bind_address = '0.0.0.0' rackup_parameters = "-E #{@options[:environment]} ./config.ru -p #{@options[:port]} --host #{bind_address}" end end end
Version data entries
8 entries across 8 versions & 1 rubygems