Sha256: ab2b45b2220898996719f58d373602becf104c5bc73ac85640c5478691e2b942
Contents?: true
Size: 670 Bytes
Versions: 4
Compression:
Stored size: 670 Bytes
Contents
module Lita module Adapters class Shell < Adapter def run user = User.new(1, name: "Shell User") source = Source.new(user) puts 'Type "exit" or "quit" to end the session.' loop do print "#{robot.name} > " input = $stdin.gets.chomp.strip break if input == "exit" || input == "quit" message = Message.new(robot, input, source) Thread.new { robot.receive(message) } end end def send_messages(target, strings) puts puts strings end def shut_down puts end end Lita.register_adapter(:shell, Shell) end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lita-1.1.2 | lib/lita/adapters/shell.rb |
lita-1.1.1 | lib/lita/adapters/shell.rb |
lita-1.1.0 | lib/lita/adapters/shell.rb |
lita-1.0.0 | lib/lita/adapters/shell.rb |