Class: Commander::HelpFormatter::Terminal

Inherits:
Base show all
Defined in:
lib/commander/help_formatters/terminal.rb

Direct Known Subclasses

TerminalCompact

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Commander::HelpFormatter::Base

Instance Method Details

#renderObject


6
7
8
# File 'lib/commander/help_formatters/terminal.rb', line 6

def render
  template(:help).result @runner.get_binding
end

#render_command(command) ⇒ Object


10
11
12
# File 'lib/commander/help_formatters/terminal.rb', line 10

def render_command(command)
  template(:command_help).result command.get_binding
end

#template(name) ⇒ Object


14
15
16
# File 'lib/commander/help_formatters/terminal.rb', line 14

def template(name)
  ERB.new(File.read(File.join(File.dirname(__FILE__), 'terminal', "#{name}.erb")), nil, '-')
end