class LogView::DoTail

Protected Instance Methods

execute_command(server, channel, file) click to toggle source
# File lib/log_view/do_tail.rb, line 6
def execute_command server, channel, file
  channel.on_data {|ch, data| puts create_split(data, server, file)}
  puts channel.exec(" tail -f #{file}" + @obj_config.grep_string + "\n")
end

Private Instance Methods

create_split(data, server, file) click to toggle source
# File lib/log_view/do_tail.rb, line 12
def create_split data, server, file
  if @obj_config.options.split_log == true
    string = "\n[#{paint(32, server)}:#{paint(33,file)}]:\n#{data}\n"
  else
    string = ":\n#{data}\n"
  end

  string
end