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 module Guard
class GuardName < Guard class GuardName < Guard
def initialize(watchers = [], options = {})
super
# init stuff here, thx!
end
# ================ # ================
# = Guard method = # = Guard method =
# ================ # ================
# Call once when guard starts # Call once when guard starts
# Please override initialize method to init stuff
def start def start
true true
end end
@ -144,11 +150,13 @@ lib/guard/guard-name.rb inherit from guard/guard and should overwrite at least o
end end
# Call with Ctrl-Z signal # Call with Ctrl-Z signal
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
def reload def reload
true true
end end
# Call with Ctrl-/ signal # Call with Ctrl-/ signal
# This method should be principally used for long action like running all specs/tests/...
def run_all def run_all
true true
end end
@ -179,7 +187,7 @@ Guardfile DSL consists of just two simple methods: guard & watch. Example:
== TODO == 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 == Development

View File

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