Sha256: b0826e5288bfd553bc9374f1e2e9d52b642341c9e7601dcfe760d7a282047919

Contents?: true

Size: 268 Bytes

Versions: 1

Compression:

Stored size: 268 Bytes

Contents

require 'bundler/setup'
require 'console'

class Demo
  include Console

  define_cmd(:hello, "print hello") do
    puts "hello #{`whoami`}"
  end

  define_cmd(:rand, "output rand number") do |max = 100|
    puts rand(max.to_i)
  end
end

Demo.new.start("demo > ")

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_console-0.0.1 examples/demo.rb