Class: YARD::CLI::Display
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
YARD::CLI::Yardoc
|
Defined in: | lib/yard/cli/display.rb |
Overview
Display
one object
Constant Summary
YardoptsCommand
- Inherited
Class Method Summary
- .new(*args) ⇒ Display constructor
Yardoc
- Inherited
.new | Creates a new instance of the commandline utility. |
YardoptsCommand
- Inherited
.new | Creates a new command that reads .yardopts. |
Command
- Inherited
.run | Helper method to run the utility on an instance. |
Instance Attribute Summary
Yardoc
- Inherited
#apis | Keep track of which APIs are to be shown. |
#assets, #excluded, #fail_on_warning, #files, #generate, #has_markup, | |
#hidden_apis | Keep track of which APIs are to be hidden. |
#hidden_tags, #list, #options, #save_yardoc, #statistics, #use_cache, | |
#visibilities | Keep track of which visibilities are to be shown. |
YardoptsCommand
- Inherited
#options_file | The options file name (defaults to |
#use_document_file, #use_yardopts_file |
Instance Method Summary
- #description
- #format_objects ⇒ String
- #output_options(opts)
-
#parse_arguments(*args)
Parses commandline options.
-
#run(*args) ⇒ void
Runs the commandline utility, parsing arguments and displaying an object from the
::YARD::Registry
. - #wrap_layout(contents)
Yardoc
- Inherited
#all_objects | The list of all objects to process. |
#description, | |
#parse_arguments | Parses commandline arguments. |
#run | Runs the commandline utility, parsing arguments and generating output if set. |
#add_api_verifier | Adds verifier rule for APIs. |
#add_extra_files | Adds a set of extra documentation files to be processed. |
#add_tag, | |
#add_visibility_verifier | Adds verifier rule for visibilities. |
#apply_locale | Applies the specified locale to collected objects. |
#copy_assets | Copies any assets to the output directory. |
#extra_file_valid?, | |
#general_options | Adds general options. |
#optparse | Parses commandline options. |
#output_options | Adds output options. |
#parse_files | Parses the file arguments into Ruby files and extra files, which are separated by a '-' element. |
#print_list | Prints a list of all objects. |
#run_generate | Generates output for objects. |
#run_verifier | Runs a list of objects against the |
#tag_options | Adds tag options. |
#verify_markup_options | Verifies that the markup options are valid before parsing any code. |
YardoptsCommand
- Inherited
#parse_arguments | Parses commandline arguments. |
#parse_rdoc_document_file, #parse_yardopts, | |
#parse_yardopts_options | Parses out the yardopts/document options. |
#support_rdoc_document_file! | Reads a .document file in the directory to get source file globs. |
#yardopts | Parses the .yardopts file for default yard options. |
Command
- Inherited
Constructor Details
.new(*args) ⇒ Display
# File 'lib/yard/cli/display.rb', line 9
def initialize(*args) super .format = :text # default for this command @layout = nil @objects = [] end
Instance Method Details
#description
# File 'lib/yard/cli/display.rb', line 7
def description; 'Displays a formatted object' end
#format_objects ⇒ String
# File 'lib/yard/cli/display.rb', line 27
def format_objects @objects.inject([]) do |arr, obj| arr.push obj.format( ) end.join("\n") end
#output_options(opts)
# File 'lib/yard/cli/display.rb', line 61
def (opts) super(opts) opts.on('-l', '--layout [LAYOUT]', 'Wraps output in layout template (good for HTML)') do |layout| @layout = layout || 'layout' end end
#parse_arguments(*args)
Parses commandline options.
#run(*args) ⇒ void
This method returns an undefined value.
Runs the commandline utility, parsing arguments and displaying an object
from the ::YARD::Registry
.
# File 'lib/yard/cli/display.rb', line 21
def run(*args) return unless parse_arguments(*args) log.puts wrap_layout(format_objects) end