Permalink
Browse files

Remove template methods in the Guard plugin parent class.

When providing templates methods, Guard assumes the plugin
is ported to the new plugin API introduced in 1.0.

In order to have proper documentation for the template methods,
we use YARD's `@!method` tag.
  • Loading branch information...
1 parent ad519fc commit 10f28cc72d0e15cc48f72a1e74954c20b1147601 @netzpirat netzpirat committed Jul 2, 2012
Showing with 16 additions and 19 deletions.
  1. +16 −19 lib/guard/guard.rb
View
@@ -77,78 +77,75 @@ def self.init(name)
end
end
- def to_s
- self.class.to_s
- end
-
# Call once when Guard starts. Please override initialize method to init stuff.
#
# @raise [:task_has_failed] when start has failed
# @return [Object] the task result
#
- def start
- end
+ # @!method start
# Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
#
# @raise [:task_has_failed] when stop has failed
# @return [Object] the task result
#
- def stop
- end
+ # @!method stop
# 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
# @return [Object] the task result
#
- def reload
- end
+ # @!method reload
# 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
# @return [Object] the task result
#
- def run_all
- end
+ # @!method run_all
# Default behaviour on file(s) changes that the Guard plugin watches.
#
# @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_changes has failed
# @return [Object] the task result
#
- def run_on_changes(paths)
- end
+ # @!method run_on_changes(paths)
# Called on file(s) additions that the Guard plugin watches.
#
# @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_additions has failed
# @return [Object] the task result
#
- def run_on_additions(paths)
- end
+ # @!method run_on_additions(paths)
# Called on file(s) modifications that the Guard plugin watches.
#
# @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_modifications has failed
# @return [Object] the task result
#
- def run_on_modifications(paths)
- end
+ # @!method run_on_modifications(paths)
# Called on file(s) removals that the Guard plugin watches.
#
# @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_removals has failed
# @return [Object] the task result
#
- def run_on_removals(paths)
+ # @!method run_on_removals(paths)
+
+ # Convert plugin to string representation. The
+ # default just uses the plugin class name.
+ #
+ # @return [String] the string representation
+ #
+ def to_s
+ self.class.to_s
end
end

0 comments on commit 10f28cc

Please sign in to comment.