Sha256: 58b0de1a5a9d30f5149f4b6af6f75f234d70e65e39ddb04036835281711aaed9

Contents?: true

Size: 360 Bytes

Versions: 2

Compression:

Stored size: 360 Bytes

Contents

module Console; module DefaultCommands
  def self.included(cls)
    cls.instance_eval do

      define_cmd(:help, "show commands") do
        self.class.commands.each do |key, val|
          puts "  #{key}: #{val[:desc]}"
        end
      end

      define_cmd(:exit, "quit client") do
        puts 'good bye!'
        exit
      end

    end
  end
end; end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_console-0.0.3 lib/console/default_commands.rb
simple_console-0.0.2 lib/console/default_commands.rb