Merge pull request #1164 from yui-knk/fix-yard-doc
Fix yard documentation warnings(fix #1163)
This commit is contained in:
commit
fe3ae6194d
|
@ -312,7 +312,7 @@ class Pry
|
|||
alias_method :to_h, :to_hash
|
||||
|
||||
# Find a command that matches the given line
|
||||
# @param [String] val The line that might be a command invocation
|
||||
# @param [String] pattern The line that might be a command invocation
|
||||
# @return [Pry::Command, nil]
|
||||
def [](pattern)
|
||||
@commands.values.select do |command|
|
||||
|
|
|
@ -76,7 +76,7 @@ class Pry
|
|||
|
||||
# pretty-print a list of matching methods.
|
||||
#
|
||||
# @param Array[Method]
|
||||
# @param [Array<Method>] matches
|
||||
def print_matches(matches)
|
||||
grouped = matches.group_by(&:owner)
|
||||
order = grouped.keys.sort_by{ |x| x.name || x.to_s }
|
||||
|
@ -111,9 +111,9 @@ class Pry
|
|||
|
||||
# Run the given block against every constant in the provided namespace.
|
||||
#
|
||||
# @param Module The namespace in which to start the search.
|
||||
# @param Hash[Module,Boolean] The namespaces we've already visited (private)
|
||||
# @yieldparam klazz Each class/module in the namespace.
|
||||
# @param [Module] klass The namespace in which to start the search.
|
||||
# @param [Hash<Module,Boolean>] done The namespaces we've already visited (private)
|
||||
# @yieldparam klass Each class/module in the namespace.
|
||||
#
|
||||
def recurse_namespace(klass, done={}, &block)
|
||||
return if !(Module === klass) || done[klass]
|
||||
|
@ -139,10 +139,10 @@ class Pry
|
|||
|
||||
# Gather all the methods in a namespace that pass the given block.
|
||||
#
|
||||
# @param Module The namespace in which to search.
|
||||
# @yieldparam Method The method to test
|
||||
# @yieldreturn Boolean
|
||||
# @return Array[Method]
|
||||
# @param [Module] namespace The namespace in which to search.
|
||||
# @yieldparam [Method] method The method to test
|
||||
# @yieldreturn [Boolean]
|
||||
# @return [Array<Method>]
|
||||
#
|
||||
def search_all_methods(namespace)
|
||||
done = Hash.new{ |h,k| h[k] = {} }
|
||||
|
@ -163,8 +163,8 @@ class Pry
|
|||
# Search for all methods with a name that matches the given regex
|
||||
# within a namespace.
|
||||
#
|
||||
# @param Module The namespace to search
|
||||
# @return Array[Method]
|
||||
# @param [Module] namespace The namespace to search
|
||||
# @return [Array<Method>]
|
||||
#
|
||||
def name_search(namespace)
|
||||
search_all_methods(namespace) do |meth|
|
||||
|
@ -175,8 +175,8 @@ class Pry
|
|||
# Search for all methods who's implementation matches the given regex
|
||||
# within a namespace.
|
||||
#
|
||||
# @param Module The namespace to search
|
||||
# @return Array[Method]
|
||||
# @param [Module] namespace The namespace to search
|
||||
# @return [Array<Method>]
|
||||
#
|
||||
def content_search(namespace)
|
||||
search_all_methods(namespace) do |meth|
|
||||
|
|
|
@ -37,7 +37,7 @@ class Pry
|
|||
|
||||
# Display the index view, with headings and short descriptions per command.
|
||||
#
|
||||
# @param Hash[String => Array[Commands]]
|
||||
# @param [Hash<String, Array<Commands>>] groups
|
||||
def display_index(groups)
|
||||
help_text = []
|
||||
|
||||
|
@ -56,7 +56,7 @@ class Pry
|
|||
# return the help string for those commands.
|
||||
#
|
||||
# @param [String] name The group name.
|
||||
# @param [Array<Pry::Command>]] commands
|
||||
# @param [Array<Pry::Command>] commands
|
||||
# @return [String] The generated help string.
|
||||
def help_text_for_commands(name, commands)
|
||||
"#{text.bold(name)}\n" << commands.map do |command|
|
||||
|
@ -130,8 +130,8 @@ class Pry
|
|||
# otherwise a sub-Hash with every key that matches the search will
|
||||
# be returned.
|
||||
#
|
||||
# @param [String] the search term
|
||||
# @param [Hash] the hash to search
|
||||
# @param [String] search the search term
|
||||
# @param [Hash] hash the hash to search
|
||||
def search_hash(search, hash)
|
||||
matching = {}
|
||||
|
||||
|
@ -149,8 +149,8 @@ class Pry
|
|||
|
||||
# Clean search terms to make it easier to search group names
|
||||
#
|
||||
# @param String
|
||||
# @return String
|
||||
# @param [String] key
|
||||
# @return [String]
|
||||
def normalize(key)
|
||||
key.downcase.gsub(/pry\W+/, '')
|
||||
end
|
||||
|
|
|
@ -37,8 +37,8 @@ class Pry
|
|||
]
|
||||
|
||||
# Return a new completion proc for use by Readline.
|
||||
# @param [Binding] target The current binding context.
|
||||
# @param [Array<String>] commands The array of Pry commands.
|
||||
# @param [Binding] input The current binding context.
|
||||
# @param [Array<String>] options The array of Pry commands.
|
||||
def self.call(input, options)
|
||||
|
||||
custom_completions = options[:custom_completions] || []
|
||||
|
|
|
@ -69,8 +69,8 @@ class Pry
|
|||
# This is necessarily done by String manipulation because we can't find out what
|
||||
# syntax is needed for the argument list by ruby-level introspection.
|
||||
#
|
||||
# @param String The original definition line. e.g. def self.foo(bar, baz=1)
|
||||
# @return String The new definition line. e.g. def foo(bar, baz=1)
|
||||
# @param [String] line The original definition line. e.g. def self.foo(bar, baz=1)
|
||||
# @return [String] The new definition line. e.g. def foo(bar, baz=1)
|
||||
def definition_for_owner(line)
|
||||
if line =~ /\Adef (?:.*?\.)?#{Regexp.escape(method.original_name)}(?=[\(\s;]|$)/
|
||||
"def #{method.original_name}#{$'}"
|
||||
|
|
|
@ -51,7 +51,7 @@ class Pry
|
|||
end
|
||||
|
||||
# Load the given file in the context of `Pry.toplevel_binding`
|
||||
# @param [String] file_name The unexpanded file path.
|
||||
# @param [String] file The unexpanded file path.
|
||||
def self.load_file_at_toplevel(file)
|
||||
toplevel_binding.eval(File.read(file), file)
|
||||
rescue RescuableException => e
|
||||
|
@ -166,7 +166,7 @@ class Pry
|
|||
# An inspector that clips the output to `max_length` chars.
|
||||
# In case of > `max_length` chars the `#<Object...> notation is used.
|
||||
#
|
||||
# @param [Object] object
|
||||
# @param [Object] obj
|
||||
# The object to view.
|
||||
#
|
||||
# @param [Hash] options
|
||||
|
|
Loading…
Reference in New Issue