Sha256: 6bfd8b816105fb0e6f19ffd24a5ad2cf996f09368dce2cbe7380ec0a3802a608

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

require_relative './base_controller.rb'

module LogsExplorer
  class LogsController < LogsExplorer::BaseController

    if LogsExplorer.enabled
      def watch; end

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

      def download
        send_file log_file.path
      end

      def log_file
        @log_file ||= begin
          item = LogsExplorer.logs.detect {|e| e[:name] == params[:name]}
          LogFile.new(path: item[:path], client_total_lines: params[:client_total_lines])
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logs_explorer-0.1.4 app/controllers/logs_explorer/logs_controller.rb
logs_explorer-0.1.3 app/controllers/logs_explorer/logs_controller.rb