Class: YARD::CLI::MarkupTypes

Inherits:
Command
  • Object
show all
Defined in:
lib/yard/cli/markup_types.rb

Overview

Lists all markup types

Since:

  • 0.8.6

Instance Method Summary collapse

Instance Method Details

#descriptionObject

Since:

  • 0.8.6


6
# File 'lib/yard/cli/markup_types.rb', line 6

def description; 'Lists all available markup types and libraries' end

#run(*args) ⇒ void

This method returns an undefined value.

Runs the commandline utility, parsing arguments and displaying a list of markup types

Parameters:

Since:

  • 0.8.6


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/yard/cli/markup_types.rb', line 13

def run(*args)
  log.puts "Available markup types for `doc' command:"
  log.puts
  types = Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS
  exts = Templates::Helpers::MarkupHelper::MARKUP_EXTENSIONS
  types.sort_by {|name, _| name.to_s }.each do |name, providers|
    log.puts "[#{name}]"
    libs = providers.map {|p| p[:lib] }.compact
    if libs.size > 0
      log.puts "  Providers: #{libs.join(" ")}"
    end
    if exts[name]
      log.puts "  Extensions: #{exts[name].map {|e| ".#{e}"}.join(" ")}"
    end

    log.puts
  end
end