Module: Logs::ApplicationHelper

Included in:
LogsController
Defined in:
app/helpers/logs/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#download_log_path(log_name) ⇒ Object



11
12
13
# File 'app/helpers/logs/application_helper.rb', line 11

def download_log_path(log_name)
  download_path + "?f=" + log_name
end

#lines(file_path_name) ⇒ Object



19
20
21
# File 'app/helpers/logs/application_helper.rb', line 19

def lines(file_path_name)
  `cat #{ file_path_name } | wc -l`.to_s
end

#log_fileObject



3
4
5
# File 'app/helpers/logs/application_helper.rb', line 3

def log_file
  (params[:name] || Rails.env) + '.log'
end

#log_file_path(log_name) ⇒ Object



7
8
9
# File 'app/helpers/logs/application_helper.rb', line 7

def log_file_path(log_name)
  root_path + log_name
end

#tail_log_path(log_name) ⇒ Object



15
16
17
# File 'app/helpers/logs/application_helper.rb', line 15

def tail_log_path(log_name)
  tail_path + "?f=" + log_name
end