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


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

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

#render_command(command) ⇒ Object


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

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

#template(name) ⇒ Object


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

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