Class: Guard::Restarter

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/restarter.rb

Constant Summary collapse

VERSION =
"0.0.3"

Instance Method Summary collapse

Constructor Details

#initialize(watchers = [], options = {}) ⇒ Restarter

Returns a new instance of Restarter.



9
10
11
12
13
14
15
# File 'lib/guard/restarter.rb', line 9

def initialize(watchers = [], options = {})
  super
  @pid = nil
  @command = options[:command]
  @spawn = options[:spawn]
  raise "Must provide option :command or :spawn" unless @command || @spawn
end

Instance Method Details

#run_on_changes(paths) ⇒ Object



22
23
24
25
26
# File 'lib/guard/restarter.rb', line 22

def run_on_changes(paths)
  run_info
  stop_server
  start_server
end

#startObject



17
18
19
20
# File 'lib/guard/restarter.rb', line 17

def start()
  start_info
  start_server
end

#stopObject



28
# File 'lib/guard/restarter.rb', line 28

def stop() stop_server end