123456789_123456789_123456789_123456789_123456789_

Class: YARD::Server::Commands::ListCommand

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: YARD::Server::Commands::LibraryCommand
Defined in: lib/yard/server/commands/list_command.rb

Overview

Returns a list of objects of a specific type

Since:

  • 0.6.0

Class Method Summary

LibraryCommand - Inherited

Base - Inherited

.new

Creates a new command object, setting attributes named by keys in the options hash.

Instance Attribute Summary

Instance Method Summary

::YARD::Templates::Helpers::BaseHelper - Included

#format_object_title, #format_object_type,
#format_source

Indents and formats source code.

#format_types

Formats a list of return types for output and links each type.

#globals

An object that keeps track of global state throughout the entire template rendering process (including any sub-templates).

#h

Escapes text.

#link_file

Links to an extra file.

#link_include_file

Include a file as a docstring in output.

#link_include_object

Includes an object's docstring into output.

#link_object

Links to an object with an optional title.

#link_url

Links to a URL.

#linkify

Links objects or URLs.

#run_verifier

Runs a list of objects against the ::YARD::Verifier object passed into the template and returns the subset of verified objects.

LibraryCommand - Inherited

#call, #call_with_fork, #call_without_fork,
#fulldoc_template

Hack to load a custom fulldoc template object that does not do any rendering/generation.

#load_yardoc, #not_prepared, #restore_template_info, #save_default_template_info, #setup_library, #setup_yardopts

Base - Inherited

#call

The main method called by a router with a request object.

#run

Subclass this method to implement a custom command.

#add_cache_control

Add a conservative cache control policy to reduce load on requests served with "?1234567890" style timestamp query strings.

Constructor Details

This class inherits a constructor from YARD::Server::Commands::LibraryCommand

Instance Method Details

#run

Since:

  • 0.6.0

[ GitHub ]

  
# File 'lib/yard/server/commands/list_command.rb', line 9

def run
  Registry.load_all
  options.update(:objects => run_verifier(Registry.all(:class, :module)))
  list_type = request.path.split('/').last
  meth = "generate_#{list_type}_list"
  tpl = fulldoc_template
  if tpl.respond_to?(meth)
    tpl.send(meth)
    cache(tpl.contents)
  else
    not_found
  end
end