Class: KamalX::ConnectionHandler

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/kamalx.rb

Instance Method Summary collapse

Constructor Details

#initialize(progress_bar) ⇒ ConnectionHandler

Returns a new instance of ConnectionHandler.



117
118
119
120
# File 'lib/kamalx.rb', line 117

def initialize(progress_bar)
  super()
  @progress_bar = progress_bar
end

Instance Method Details

#receive_data(data) ⇒ Object



122
123
124
125
126
127
128
129
# File 'lib/kamalx.rb', line 122

def receive_data(data)
  parser = LogParser.new
  data.each_line do |line|
    parsed_line = parser.parse(line)
    KamalX.display_line(parsed_line)
    @progress_bar.update(line)
  end
end

#unbindObject



131
132
133
134
# File 'lib/kamalx.rb', line 131

def unbind
  @progress_bar.finish
  KamalX.command_finished
end