Class: SweetStaging::LogsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/sweet_staging/logs_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#active?, #format_datetime, #icon, #insert_css_file, #insert_js_file

Instance Method Details

#changesObject



10
11
12
13
# File 'app/controllers/sweet_staging/logs_controller.rb', line 10

def changes
  @lines       = log_file.readlines
  @total_lines = log_file.total_lines
end

#log_fileObject



15
16
17
18
19
20
# File 'app/controllers/sweet_staging/logs_controller.rb', line 15

def log_file
  @log_file ||= begin
    item = SweetStaging.logs.detect {|e| e[:name] == params[:name]}
    LogFile.new(path: "#{::Rails.root}/#{item[:path]}", client_total_lines: params[:client_total_lines])
  end
end

#watchObject



7
8
# File 'app/controllers/sweet_staging/logs_controller.rb', line 7

def watch
end