Class: Guard::FixtureBuilder

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

Instance Method Summary collapse

Constructor Details

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

Initialize a Guard.

Parameters:

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

    the Guard file watchers

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

    the custom Guard options



9
10
11
# File 'lib/guard/fixture_builder.rb', line 9

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



27
28
# File 'lib/guard/fixture_builder.rb', line 27

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



33
34
# File 'lib/guard/fixture_builder.rb', line 33

def run_all
end

#run_on_changes(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



39
40
41
# File 'lib/guard/fixture_builder.rb', line 39

def run_on_changes(paths)
  run_fixture_builder
end

#run_on_removals(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



46
47
# File 'lib/guard/fixture_builder.rb', line 46

def run_on_removals(paths)
end

#startObject

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

Raises:

  • (:task_has_failed)

    when start has failed



15
16
17
# File 'lib/guard/fixture_builder.rb', line 15

def start
  run_fixture_builder
end

#stopObject

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

Raises:

  • (:task_has_failed)

    when stop has failed



21
22
# File 'lib/guard/fixture_builder.rb', line 21

def stop
end