Skip to content

Commit

Permalink
Remove template methods in the Guard plugin parent class.
Browse files Browse the repository at this point in the history
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
netzpirat committed Jul 2, 2012
1 parent ad519fc commit 10f28cc
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions lib/guard/guard.rb
Expand Up @@ -77,78 +77,75 @@ def self.init(name)
end end
end end


def to_s
self.class.to_s
end

# Call once when Guard starts. Please override initialize method to init stuff. # Call once when Guard starts. Please override initialize method to init stuff.
# #
# @raise [:task_has_failed] when start has failed # @raise [:task_has_failed] when start has failed
# @return [Object] the task result # @return [Object] the task result
# #
def start # @!method start
end


# Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits). # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
# #
# @raise [:task_has_failed] when stop has failed # @raise [:task_has_failed] when stop has failed
# @return [Object] the task result # @return [Object] the task result
# #
def stop # @!method stop
end


# Called when `reload|r|z + enter` is pressed. # Called when `reload|r|z + enter` is pressed.
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/... # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
# #
# @raise [:task_has_failed] when reload has failed # @raise [:task_has_failed] when reload has failed
# @return [Object] the task result # @return [Object] the task result
# #
def reload # @!method reload
end


# Called when just `enter` is pressed # Called when just `enter` is pressed
# This method should be principally used for long action like running all specs/tests/... # This method should be principally used for long action like running all specs/tests/...
# #
# @raise [:task_has_failed] when run_all has failed # @raise [:task_has_failed] when run_all has failed
# @return [Object] the task result # @return [Object] the task result
# #
def run_all # @!method run_all
end


# Default behaviour on file(s) changes that the Guard plugin watches. # Default behaviour on file(s) changes that the Guard plugin watches.
# #
# @param [Array<String>] paths the changes files or paths # @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_changes has failed # @raise [:task_has_failed] when run_on_changes has failed
# @return [Object] the task result # @return [Object] the task result
# #
def run_on_changes(paths) # @!method run_on_changes(paths)
end


# Called on file(s) additions that the Guard plugin watches. # Called on file(s) additions that the Guard plugin watches.
# #
# @param [Array<String>] paths the changes files or paths # @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_additions has failed # @raise [:task_has_failed] when run_on_additions has failed
# @return [Object] the task result # @return [Object] the task result
# #
def run_on_additions(paths) # @!method run_on_additions(paths)
end


# Called on file(s) modifications that the Guard plugin watches. # Called on file(s) modifications that the Guard plugin watches.
# #
# @param [Array<String>] paths the changes files or paths # @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_modifications has failed # @raise [:task_has_failed] when run_on_modifications has failed
# @return [Object] the task result # @return [Object] the task result
# #
def run_on_modifications(paths) # @!method run_on_modifications(paths)
end


# Called on file(s) removals that the Guard plugin watches. # Called on file(s) removals that the Guard plugin watches.
# #
# @param [Array<String>] paths the changes files or paths # @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_removals has failed # @raise [:task_has_failed] when run_on_removals has failed
# @return [Object] the task result # @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


end end
Expand Down

0 comments on commit 10f28cc

Please sign in to comment.