Very simple telnet interface
This commit is contained in:

committed by
Nicholas Thomas

parent
5554ff2dbe
commit
8b5a14953f
@@ -3,11 +3,22 @@ require 'em/protocols/line_and_text'
|
||||
module SharpCoin
|
||||
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>
|
||||
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
|
||||
|
Reference in New Issue
Block a user