Class: Guard::Railstestdb

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

Instance Method Summary collapse

Constructor Details

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

Initialize a Guard.

Parameters:

  • watchers (Array<Guard::Watcher>) (defaults to: [])

    the Guard file watchers

  • options (Hash) (defaults to: {})

    the custom Guard options



12
13
14
# File 'lib/guard/railstestdb.rb', line 12

def initialize(watchers = [], options = {})
  super
end

Instance Method Details

#reloadObject

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

Raises:

  • (:task_has_failed)

    when reload has failed



29
30
# File 'lib/guard/railstestdb.rb', line 29

def reload
end

#run_allObject

Called when just ‘enter` is pressed This method should be principally used for long action like running all specs/tests/…

Raises:

  • (:task_has_failed)

    when run_all has failed



35
36
# File 'lib/guard/railstestdb.rb', line 35

def run_all
end

#run_on_change(paths) ⇒ Object

Called on file(s) modifications that the Guard watches.

Parameters:

  • paths (Array<String>)

    the changes files or paths

Raises:

  • (:task_has_failed)

    when run_on_change has failed



41
42
# File 'lib/guard/railstestdb.rb', line 41

def run_on_change(paths)
end

#run_on_deletion(paths) ⇒ Object

Called on file(s) deletions that the Guard watches.

Parameters:

  • paths (Array<String>)

    the deleted files or paths

Raises:

  • (:task_has_failed)

    when run_on_change has failed



47
48
# File 'lib/guard/railstestdb.rb', line 47

def run_on_deletion(paths)
end

#startObject

Call once when Guard starts. Please override initialize method to init stuff.

Raises:

  • (:task_has_failed)

    when start has failed



18
19
# File 'lib/guard/railstestdb.rb', line 18

def start
end

#stopObject

Called when ‘stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).

Raises:

  • (:task_has_failed)

    when stop has failed



23
24
# File 'lib/guard/railstestdb.rb', line 23

def stop
end