Class | YARD::CLI::YRI
In: | lib/yard/cli/yri.rb
Parent: | Command

A tool to view documentation in the console like `ri`

### Methods

cache_object description find_object new print_object print_usage run run

### Constants

CACHE_FILE | = | File.expand_path('~/.yard/yri_cache') |  | The location in {YARD::CONFIG_DIR} where the YRI cache file is loaded from.
SEARCH_PATHS_FILE | = | File.expand_path('~/.yard/yri_search_paths') |  | A file containing all paths, delimited by newlines, to search for yardoc databases. @since 0.5.1

DEFAULT_SEARCH_PATHS

=

[]

Default search paths that should be loaded dynamically into YRI. These paths take precedence over all other paths ({SEARCH_PATHS_FILE} and RubyGems paths). To add a path, call:

      DEFAULT_SEARCH_PATHS.push("/path/to/.yardoc")

@return [Array<String>] a list of extra search paths @since 0.6.0

### Public Class methods

new()
run(*args)

Helper method to run the utility on an instance. @see run

### Public Instance methods

description()
run(*args)

Runs the command-line utility.

@example

      YRI.new.run('String#reverse')

@param [Array<String>] args each tokenized argument

### Protected Instance methods

cache_object(name, path)

Caches the .yardoc file where an object can be found in the {CACHE_FILE} @return [void]

find_object(name)

Locates an object by name starting in the cached paths and then searching through any search paths.

@param [String] name the full name of the object @return [CodeObjects::Base] an object if found @return [nil] if no object is found

print_object(object)

@param [CodeObjects::Base] object the object to print. @return [String] the formatted output for an object.

print_usage()

Prints the command usage @return [void] @since 0.5.6

[Validate]