Class: EventMachine::SystemCmd
- Inherits:
-
Connection
- Object
- Connection
- EventMachine::SystemCmd
- Defined in:
- lib/em/processes.rb
Instance Attribute Summary
Attributes inherited from Connection
Instance Method Summary collapse
-
#initialize(cb) ⇒ SystemCmd
constructor
A new instance of SystemCmd.
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Methods inherited from Connection
#associate_callback_target, #close_connection, #close_connection_after_writing, #comm_inactivity_timeout, #comm_inactivity_timeout=, #connection_completed, #detach, #error?, #get_cipher_bits, #get_cipher_name, #get_cipher_protocol, #get_idle_time, #get_outbound_data_size, #get_peer_cert, #get_peername, #get_pid, #get_proxied_bytes, #get_sni_hostname, #get_sock_opt, #get_sockname, #get_status, new, #notify_readable=, #notify_readable?, #notify_writable=, #notify_writable?, #pause, #paused?, #pending_connect_timeout, #pending_connect_timeout=, #post_init, #proxy_completed, #proxy_incoming_to, #proxy_target_unbound, #reconnect, #resume, #send_data, #send_datagram, #send_file_data, #set_sock_opt, #ssl_handshake_completed, #ssl_verify_peer, #start_tls, #stop_proxying, #stream_file_data
Constructor Details
#initialize(cb) ⇒ SystemCmd
Returns a new instance of SystemCmd.
77 78 79 80 |
# File 'lib/em/processes.rb', line 77 def initialize cb @cb = cb @output = [] end |
Instance Method Details
#receive_data(data) ⇒ Object
81 82 83 |
# File 'lib/em/processes.rb', line 81 def receive_data data @output << data end |
#unbind ⇒ Object
84 85 86 |
# File 'lib/em/processes.rb', line 84 def unbind @cb.call @output.join(''), get_status if @cb end |