Sha256: 6ed4db56c37992dade4e4bf8d3e0136f44d1c9c5d99909ab21322cff47763cb2
Contents?: true
Size: 618 Bytes
Versions: 9
Compression:
Stored size: 618 Bytes
Contents
require 'erb' module Commander module HelpFormatter class Terminal < Base def render template(:help).result(ProgramContext.new(@runner).get_binding) end def render_command(command) template(:command_help).result(Context.new(command).get_binding) end def render_subcommand(command) bind = ProgramContext.new(@runner).get_binding({cmd: command}) template(:subcommand_help).result(bind) end def template(name) ERB.new(File.read(File.join(File.dirname(__FILE__), 'terminal', "#{name}.erb")), nil, '-') end end end end
Version data entries
9 entries across 9 versions & 1 rubygems