From 8b5a14953f5c1107565482e20aa23175bf1c3edf Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Sun, 15 May 2011 01:36:58 +0100 Subject: [PATCH] Very simple telnet interface --- lib/sharp-coin/interface/telnet.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/sharp-coin/interface/telnet.rb b/lib/sharp-coin/interface/telnet.rb index db89468..487f2d1 100644 --- a/lib/sharp-coin/interface/telnet.rb +++ b/lib/sharp-coin/interface/telnet.rb @@ -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 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