Sha256: f36d3043a08fbf7a82efd51aa3f70265066df8de0d3ec8c49ab5807d50097aef

Contents?: true

Size: 858 Bytes

Versions: 30

Compression:

Stored size: 858 Bytes

Contents

module RequestLogAnalyzer::Aggregator

  # Echo Aggregator. Writes everything to the screen when it is passed to this aggregator
  class Echo < Base

    attr_accessor :warnings

    def prepare
      @warnings = []
    end

    # Display every parsed line immediately to the terminal
    def aggregate(request)
      puts "\nRequest: \n" + request.lines.map { |l| 
        "\t#{l[:lineno]}:#{l[:line_type]}: #{l.reject { |(k,v)| [:lineno, :line_type].include?(k) }.inspect}" }.join("\n")
    end

    # Capture all warnings during parsing
    def warning(type, message, lineno)
      @warnings << "WARNING #{type.inspect} on line #{lineno}: #{message}"
    end

    # Display every warning in the report when finished parsing
    def report(output)
      output.title("Warnings during parsing")
      @warnings.each { |w| output.puts(w) }
    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
request-log-analyzer-1.12.4 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.12.3 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.12.2 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.12.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.12.0 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.11.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.11.0 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.10.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.10.0 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.10 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.9 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.8 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.7 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.6 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.5 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.4 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.3 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.2 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.1 lib/request_log_analyzer/aggregator/echo.rb
request-log-analyzer-1.9.0 lib/request_log_analyzer/aggregator/echo.rb