class Guard::Spring

Attributes

runner[RW]

Public Class Methods

new(options = {}) click to toggle source

Initialize a Guard. @param [Array<Guard::Watcher>] watchers the Guard file watchers @param [Hash] options the custom Guard options

Calls superclass method
# File lib/guard/spring.rb, line 12
def initialize(options = {})
  super
  @runner = Runner.new(options)
end

Public Instance Methods

reload() click to toggle source

Called when ‘reload|r|z + enter` is pressed. This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/… @raise [:task_has_failed] when reload has failed

# File lib/guard/spring.rb, line 32
def reload
  runner.restart
end
run_all() click to toggle source

Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/… @raise [:task_has_failed] when run_all has failed

# File lib/guard/spring.rb, line 39
def run_all
end
run_on_changes(_paths) click to toggle source

Called on file(s) modifications that the Guard watches. @param [Array<String>] paths the changes files or paths @raise [:task_has_failed] when run_on_change has failed

# File lib/guard/spring.rb, line 45
def run_on_changes(_paths)
  runner.restart
end
run_on_removals(_paths) click to toggle source

Called on file(s) deletions that the Guard watches. @param [Array<String>] paths the deleted files or paths @raise [:task_has_failed] when run_on_change has failed

# File lib/guard/spring.rb, line 52
def run_on_removals(_paths)
  runner.restart
end
start() click to toggle source

Called once when Guard starts. Please override initialize method to init stuff. @raise [:task_has_failed] when start has failed

# File lib/guard/spring.rb, line 19
def start
  runner.start
end
stop() click to toggle source

Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits). @raise [:task_has_failed] when stop has failed

# File lib/guard/spring.rb, line 25
def stop
  runner.stop
end