Very simple telnet interface

This commit is contained in:
Nick Thomas
2011-05-15 01:36:58 +01:00
committed by Nicholas Thomas
parent 5554ff2dbe
commit 8b5a14953f

View File

@@ -3,11 +3,22 @@ require 'em/protocols/line_and_text'
module SharpCoin module SharpCoin
module Interface module Interface
# Telnet API for SharpCoin. Used for debugging and administrative tasks # Telnet API for SharpCoin. Used for debugging and administrative tasks.
# Currently very basic. Will probably never be cleaned up much - aim is
# to be able to remove it by making all functions accessible via REST API.
# #
# @author Nick Thomas <nick@lupine.me.uk> # @author Nick Thomas <nick@lupine.me.uk>
class Telnet < EM::P::LineAndTextProtocol class Telnet < EM::P::LineAndTextProtocol
def receive_line(line)
send_data(eval(line))
end
def puts(data)
send_data(data + "\n")
end
def print(data)
send_data(data)
end
end end
end end