Class: Invoker::CLI::Tail
- Inherits:
-
Object
- Object
- Invoker::CLI::Tail
- Defined in:
- lib/invoker/cli/tail.rb
Instance Attribute Summary collapse
-
#process_names ⇒ Object
Returns the value of attribute process_names.
Instance Method Summary collapse
-
#initialize(process_names) ⇒ Tail
constructor
A new instance of Tail.
- #run ⇒ Object
Constructor Details
#initialize(process_names) ⇒ Tail
Returns a new instance of Tail.
4 5 6 7 8 |
# File 'lib/invoker/cli/tail.rb', line 4 def initialize(process_names) verify_process_name(process_names) @process_names = process_names @unix_socket = Invoker::IPC::UnixClient.new end |
Instance Attribute Details
#process_names ⇒ Object
Returns the value of attribute process_names.
3 4 5 |
# File 'lib/invoker/cli/tail.rb', line 3 def process_names @process_names end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/invoker/cli/tail.rb', line 10 def run socket = @unix_socket.send_and_wait('tail', process_names: process_names) trap('INT') { socket.close } loop do = read_next_line(socket) break unless puts .tail_line end end |