Class: VpsAdmin::CLI::Commands::VpsRemoteControl::InputHandler
- Inherits:
-
Object
- Object
- VpsAdmin::CLI::Commands::VpsRemoteControl::InputHandler
- Defined in:
- lib/vpsadmin/cli/commands/vps_remote_console.rb
Instance Method Summary collapse
-
#initialize(http_client) ⇒ InputHandler
constructor
A new instance of InputHandler.
- #read_from(io) ⇒ Object
- #stop? ⇒ Boolean
Constructor Details
#initialize(http_client) ⇒ InputHandler
Returns a new instance of InputHandler.
14 15 16 17 18 19 20 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 14 def initialize(http_client) @http_client = http_client @private_buffer = '' @end_seq = ["\r", "\e", '.'] @end_i = 0 @stop = false end |
Instance Method Details
#read_from(io) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 22 def read_from(io) begin data = io.read_nonblock(4096) rescue IO::WaitReadable return rescue Errno::EIO stop return end write(data) end |
#stop? ⇒ Boolean
35 36 37 |
# File 'lib/vpsadmin/cli/commands/vps_remote_console.rb', line 35 def stop? @stop end |