Yardoc improvements [ci skip]

This commit is contained in:
Rémy Coutable 2011-09-23 11:01:52 +02:00
parent a7a6c5c69e
commit 5c9ee2afdf
7 changed files with 13 additions and 25 deletions

View File

@ -18,7 +18,6 @@ module Guard
# Initialize the Guard singleton. # Initialize the Guard singleton.
# #
# @param [Hash] options the Guard options.
# @option options [Boolean] clear if auto clear the UI should be done # @option options [Boolean] clear if auto clear the UI should be done
# @option options [Boolean] notify if system notifications should be shown # @option options [Boolean] notify if system notifications should be shown
# @option options [Boolean] debug if debug output should be shown # @option options [Boolean] debug if debug output should be shown
@ -43,11 +42,11 @@ module Guard
# Smart accessor for retrieving a specific guard or several guards at once. # Smart accessor for retrieving a specific guard or several guards at once.
# #
# @param [String, Symbol] filter return the guard with the given name, or nil if not found. # @param [String, Symbol] filter return the guard with the given name, or nil if not found
# @param [Regexp] filter returns all guards matching the Regexp, or [] if no guard found. # @param [Regexp] filter returns all guards matching the Regexp, or [] if no guard found
# @param [Hash] filter returns all guards matching the given Hash. # @param [Hash] filter returns all guards matching the given Hash.
# Example: `{ :name => 'rspec', :group => 'backend' }, or [] if no guard found. # Example: `{ :name => 'rspec', :group => 'backend' }`, or [] if no guard found
# @param [NilClass] filter returns all guards. # @param [NilClass] filter returns all guards
# #
# @see Guard.groups # @see Guard.groups
# #
@ -72,9 +71,9 @@ module Guard
# Smart accessor for retrieving a specific group or several groups at once. # Smart accessor for retrieving a specific group or several groups at once.
# #
# @param [NilClass] filter returns all groups. # @param [NilClass] filter returns all groups
# @param [String, Symbol] filter return the group with the given name, or nil if not found. # @param [String, Symbol] filter return the group with the given name, or nil if not found
# @param [Regexp] filter returns all groups matching the Regexp, or [] if no group found. # @param [Regexp] filter returns all groups matching the Regexp, or [] if no group found
# #
# @see Guard.guards # @see Guard.guards
# #
@ -92,7 +91,6 @@ module Guard
# Start Guard by evaluate the `Guardfile`, initialize the declared Guards # Start Guard by evaluate the `Guardfile`, initialize the declared Guards
# and start the available file change listener. # and start the available file change listener.
# #
# @param [Hash] options the Guard options.
# @option options [Boolean] clear if auto clear the UI should be done # @option options [Boolean] clear if auto clear the UI should be done
# @option options [Boolean] notify if system notifications should be shown # @option options [Boolean] notify if system notifications should be shown
# @option options [Boolean] debug if debug output should be shown # @option options [Boolean] debug if debug output should be shown
@ -233,7 +231,7 @@ module Guard
# @param [String] name the Guard name # @param [String] name the Guard name
# @param [Array<Watcher>] watchers the list of declared watchers # @param [Array<Watcher>] watchers the list of declared watchers
# @param [Array<Hash>] callbacks the list of callbacks # @param [Array<Hash>] callbacks the list of callbacks
# @param [Hash] options the Guard options # @param [Hash] options the Guard options (see the given Guard documentation)
# #
def add_guard(name, watchers = [], callbacks = [], options = {}) def add_guard(name, watchers = [], callbacks = [], options = {})
if name.to_sym == :ego if name.to_sym == :ego
@ -248,9 +246,8 @@ module Guard
# Add a Guard group. # Add a Guard group.
# #
# @param [String] name the group name # @param [String] name the group name
# @param [Hash] options the group options
# @option options [Boolean] halt_on_fail if a task execution # @option options [Boolean] halt_on_fail if a task execution
# should be halted for all Guards in this group if one Guard throws `:task_has_failed` # should be halted for all Guards in this group if one Guard throws `:task_has_failed`
# @return [Guard::Group] the group added (or retrieved from the `@groups` variable if already present) # @return [Guard::Group] the group added (or retrieved from the `@groups` variable if already present)
# #
def add_group(name, options = {}) def add_group(name, options = {})

View File

@ -81,7 +81,6 @@ module Guard
# Evaluate the DSL methods in the `Guardfile`. # Evaluate the DSL methods in the `Guardfile`.
# #
# @param [Hash] options the Guard options
# @option options [Array<Symbol,String>] groups the groups to evaluate # @option options [Array<Symbol,String>] groups the groups to evaluate
# @option options [String] guardfile the path to a valid Guardfile # @option options [String] guardfile the path to a valid Guardfile
# @option options [String] guardfile_contents a string representing the content of a valid Guardfile # @option options [String] guardfile_contents a string representing the content of a valid Guardfile

View File

@ -9,7 +9,6 @@ module Guard
# Initialize a Group. # Initialize a Group.
# #
# @param [String] name the name of the group # @param [String] name the name of the group
# @param [Hash] options the group options
# @option options [Boolean] halt_on_fail if a task execution # @option options [Boolean] halt_on_fail if a task execution
# should be halted for all Guards in this group if one Guard throws `:task_has_failed` # should be halted for all Guards in this group if one Guard throws `:task_has_failed`
# #

View File

@ -16,7 +16,7 @@ module Guard
# Initialize a Guard. # Initialize a Guard.
# #
# @param [Array<Guard::Watcher>] watchers the Guard file watchers # @param [Array<Guard::Watcher>] watchers the Guard file watchers
# @param [Hash] options the custom Guard options. # @param [Hash] options the custom Guard options
# #
def initialize(watchers = [], options = {}) def initialize(watchers = [], options = {})
@group = options[:group] ? options.delete(:group).to_sym : :default @group = options[:group] ? options.delete(:group).to_sym : :default

View File

@ -43,7 +43,6 @@ module Guard
# Initialize the listener. # Initialize the listener.
# #
# @param [String] directory the root directory to listen to # @param [String] directory the root directory to listen to
# @param [Hash] options the listener options
# @option options [Boolean] relativize_paths use only relative paths # @option options [Boolean] relativize_paths use only relative paths
# @option options [Array<String>] ignore_paths the paths to ignore by the listener # @option options [Array<String>] ignore_paths the paths to ignore by the listener
# #
@ -187,7 +186,6 @@ module Guard
# Gets a list of files that are in the modified directories. # Gets a list of files that are in the modified directories.
# #
# @param [Array<String>] dirs the list of directories # @param [Array<String>] dirs the list of directories
# @param [Hash] options the options
# @option options [Symbol] all whether to include all files # @option options [Symbol] all whether to include all files
# #
def potentially_modified_files(dirs, options = {}) def potentially_modified_files(dirs, options = {})

View File

@ -43,7 +43,6 @@ module Guard
# @see .image_path # @see .image_path
# #
# @param [String] the message to show # @param [String] the message to show
# @param [Hash] options the notification options
# @option options [Symbol, String] image the image symbol or path to an image # @option options [Symbol, String] image the image symbol or path to an image
# @option options [String] title the notification title # @option options [String] title the notification title
# #
@ -80,7 +79,7 @@ module Guard
# @param [Symbol, String] the image to user # @param [Symbol, String] the image to user
# @param [Hash] options the growl options # @param [Hash] options the growl options
# #
def self.notify_mac(title, message, image, options) def self.notify_mac(title, message, image, options = {})
require_growl # need for guard-rspec formatter that is called out of guard scope require_growl # need for guard-rspec formatter that is called out of guard scope
default_options = { :title => title, :icon => image_path(image), :name => APPLICATION_NAME } default_options = { :title => title, :icon => image_path(image), :name => APPLICATION_NAME }
@ -104,7 +103,7 @@ module Guard
# @param [Symbol, String] the image to user # @param [Symbol, String] the image to user
# @param [Hash] options the libnotify options # @param [Hash] options the libnotify options
# #
def self.notify_linux(title, message, image, options) def self.notify_linux(title, message, image, options = {})
require_libnotify # need for guard-rspec formatter that is called out of guard scope require_libnotify # need for guard-rspec formatter that is called out of guard scope
default_options = { :body => message, :summary => title, :icon_path => image_path(image), :transient => true } default_options = { :body => message, :summary => title, :icon_path => image_path(image), :transient => true }
Libnotify.show default_options.merge(options) if enabled? Libnotify.show default_options.merge(options) if enabled?
@ -117,7 +116,7 @@ module Guard
# @param [Symbol, String] the image to user # @param [Symbol, String] the image to user
# @param [Hash] options the notifu options # @param [Hash] options the notifu options
# #
def self.notify_windows(title, message, image, options) def self.notify_windows(title, message, image, options = {})
require_rbnotifu # need for guard-rspec formatter that is called out of guard scope require_rbnotifu # need for guard-rspec formatter that is called out of guard scope
default_options = { :message => message, :title => title, :type => image_level(image), :time => 3 } default_options = { :message => message, :title => title, :type => image_level(image), :time => 3 }
Notifu.show default_options.merge(options) if enabled? Notifu.show default_options.merge(options) if enabled?

View File

@ -10,7 +10,6 @@ module Guard
# Show an info message. # Show an info message.
# #
# @param [String] message the message to show # @param [String] message the message to show
# @param [Hash] options the options
# @option options [Boolean] reset whether to clean the output before # @option options [Boolean] reset whether to clean the output before
# #
def info(message, options = { }) def info(message, options = { })
@ -23,7 +22,6 @@ module Guard
# Show a red error message that is prefixed with ERROR. # Show a red error message that is prefixed with ERROR.
# #
# @param [String] message the message to show # @param [String] message the message to show
# @param [Hash] options the options
# @option options [Boolean] reset whether to clean the output before # @option options [Boolean] reset whether to clean the output before
# #
def error(message, options = { }) def error(message, options = { })
@ -36,7 +34,6 @@ module Guard
# Show a red deprecation message that is prefixed with DEPRECATION. # Show a red deprecation message that is prefixed with DEPRECATION.
# #
# @param [String] message the message to show # @param [String] message the message to show
# @param [Hash] options the options
# @option options [Boolean] reset whether to clean the output before # @option options [Boolean] reset whether to clean the output before
# #
def deprecation(message, options = { }) def deprecation(message, options = { })
@ -49,7 +46,6 @@ module Guard
# Show a debug message that is prefixed with DEBUG and a timestamp. # Show a debug message that is prefixed with DEBUG and a timestamp.
# #
# @param [String] message the message to show # @param [String] message the message to show
# @param [Hash] options the options
# @option options [Boolean] reset whether to clean the output before # @option options [Boolean] reset whether to clean the output before
# #
def debug(message, options = { }) def debug(message, options = { })