Sha256: af7ad196c5d15962f3fc9ca534973e10966ad9137b5c99f2c794def6be8ccf13
Contents?: true
Size: 572 Bytes
Versions: 23
Compression:
Stored size: 572 Bytes
Contents
require 'erb' module RCoLi module Help def help(*args) if args[0].empty? puts template('help', nil) else command = self args[0].each do |arg| command = command.find_command(arg) raise InvalidCommand, "'#{arg}' is not a valid #{@name} command" unless command end puts template('help_command', command) end end def template(name, command) ERB.new(File.read(File.join(File.dirname(__FILE__), 'templates', "#{name}.erb")), nil, '-').result binding end end end
Version data entries
23 entries across 23 versions & 1 rubygems