Updated guard methods readme

This commit is contained in:
Thibaud Guillaume-Gentil 2010-10-27 22:14:21 +02:00
parent 3d4b0d080d
commit 470e763339
2 changed files with 14 additions and 1 deletions

View File

@ -127,11 +127,17 @@ lib/guard/guard-name.rb inherit from guard/guard and should overwrite at least o
module Guard
class GuardName < Guard
def initialize(watchers = [], options = {})
super
# init stuff here, thx!
end
# ================
# = Guard method =
# ================
# Call once when guard starts
# Please override initialize method to init stuff
def start
true
end
@ -144,11 +150,13 @@ lib/guard/guard-name.rb inherit from guard/guard and should overwrite at least o
end
# Call with Ctrl-Z signal
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
def reload
true
end
# Call with Ctrl-/ signal
# This method should be principally used for long action like running all specs/tests/...
def run_all
true
end
@ -179,7 +187,7 @@ Guardfile DSL consists of just two simple methods: guard & watch. Example:
== TODO
- Add more specs, help are welcome because I'm not sure about how to test stuff like this :-)
- Add more specs! Shame on me :)
== Development

View File

@ -26,19 +26,24 @@ module Guard
# = Guard method =
# ================
# Call once when guard starts
# Please override initialize method to init stuff
def start
true
end
# Call once when guard quit
# Retrieve a true value if the instance successfuly stopped
def stop
true
end
# Should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
def reload
true
end
# Should be principally used for long action like running all specs/tests/...
def run_all
true
end