Class: KamalX::ConnectionHandler
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- KamalX::ConnectionHandler
- Defined in:
- lib/kamalx.rb
Instance Method Summary collapse
-
#initialize(progress_bar) ⇒ ConnectionHandler
constructor
A new instance of ConnectionHandler.
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(progress_bar) ⇒ ConnectionHandler
Returns a new instance of ConnectionHandler.
117 118 119 120 |
# File 'lib/kamalx.rb', line 117 def initialize() super() @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 |
#unbind ⇒ Object
131 132 133 134 |
# File 'lib/kamalx.rb', line 131 def unbind @progress_bar.finish KamalX.command_finished end |