class PBM::Commands::Help

Public Class Methods

new(interpreter) click to toggle source
# File lib/pbm/commands/help.rb, line 4
def initialize(interpreter)
  @interpreter = interpreter
end

Public Instance Methods

description() click to toggle source
# File lib/pbm/commands/help.rb, line 8
def description
  'help - displays this help'
end
run() click to toggle source
# File lib/pbm/commands/help.rb, line 12
      def run
        <<-HELP.gsub(/^ {10}/, '')

          List of commands:
          -----------------

          #{@interpreter.commands.values.map(&:description).sort.join("\n")}

        HELP
      end