Class: SimpleCommander::HelpFormatter::Terminal
- Inherits:
-
Base
- Object
- Base
- SimpleCommander::HelpFormatter::Terminal
show all
- Defined in:
- lib/simple_commander/help_formatters/terminal.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
6
7
8
9
|
# File 'lib/simple_commander/help_formatters/terminal.rb', line 6
def render
template(:help).result(ProgramContext.new(@runner).get_binding)
end
|
#render_command(command) ⇒ Object
11
12
13
|
# File 'lib/simple_commander/help_formatters/terminal.rb', line 11
def render_command(command)
template(:command_help).result(Context.new(command).get_binding)
end
|
#template(name) ⇒ Object
15
16
17
|
# File 'lib/simple_commander/help_formatters/terminal.rb', line 15
def template(name)
ERB.new(File.read(File.join(File.dirname(__FILE__), 'terminal', "#{name}.erb")), nil, '-')
end
|