Class: Polonium::ServerRunners::ExternalServerRunner

Inherits:
ServerRunner
  • Object
show all
Defined in:
lib/polonium/server_runners/external_server_runner.rb

Constant Summary collapse

DEFAULT_START_SERVER_COMMAND =
lambda do |configuration|
  "cd #{configuration.rails_root}; script/server -e #{configuration.rails_env} -p #{configuration.internal_app_server_port} -c #{configuration.rails_root}"
end
DEFAULT_STOP_SERVER_COMMAND =
lambda do |configuration|
  "ps ax | grep 'script/server -e #{configuration.rails_env}' | sed /grep/d | awk '{print $1}' | xargs kill -9 2>/dev/null"
end

Instance Attribute Summary

Attributes inherited from ServerRunner

#configuration

Class Method Summary collapse

Methods inherited from ServerRunner

#initialize, #start, #started?, #stop

Constructor Details

This class inherits a constructor from Polonium::ServerRunners::ServerRunner

Class Method Details

.start_server_command(&blk) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/polonium/server_runners/external_server_runner.rb', line 12

def start_server_command(&blk)
  if blk
    @start_server_command = blk
  else
    @start_server_command ||= DEFAULT_START_SERVER_COMMAND
  end
end

.stop_server_command(&blk) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/polonium/server_runners/external_server_runner.rb', line 20

def stop_server_command(&blk)
  if blk
    @stop_server_command = blk
  else
    @stop_server_command ||= DEFAULT_STOP_SERVER_COMMAND
  end
end