Method: TailCommandBuilder#command

Defined in:
lib/clarity/commands/tail_command_builder.rb

#commandObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/clarity/commands/tail_command_builder.rb', line 11

def command
  results = []
  exec_functions.each_with_index do |cmd, index|
    if index == 0
      results << cmd.gsub('filename', filename.to_s)
    else
      results << cmd.gsub('filename', filename.to_s).gsub('options', options.to_s).gsub('term', terms[index-1].to_s)
    end
  end
  %[sh -c '#{results.join(" | ")}']
end