class Necro::CommandWorker
Attributes
color[RW]
command_label[RW]
pid[RW]
pipe_end[RW]
Public Class Methods
new(command_label, pipe_end, pid, color)
click to toggle source
# File lib/necro/command_worker.rb, line 5 def initialize(command_label, pipe_end, pid, color) @command_label = command_label @pipe_end = pipe_end @pid = pid @color = color end
Public Instance Methods
receive_data(data)
click to toggle source
Copied verbatim from Eventmachine code
# File lib/necro/command_worker.rb, line 13 def receive_data data (@buf ||= '') << data while @buf.slice!(/(.*?)\r?\n/) receive_line($1) end end
receive_line(line)
click to toggle source
Print the lines received over the network
# File lib/necro/command_worker.rb, line 26 def receive_line(line) $stdout.puts "#{@command_label.send(color)} : #{line}" end
unbind()
click to toggle source
# File lib/necro/command_worker.rb, line 21 def unbind # $stdout.print(".") end