Module: RequestLogAnalyzer

Defined in:
lib/request_log_analyzer.rb,
lib/request_log_analyzer/mailer.rb,
lib/request_log_analyzer/version.rb,
lib/request_log_analyzer/request.rb,
lib/request_log_analyzer/controller.rb,
lib/request_log_analyzer/log_processor.rb,
lib/request_log_analyzer/line_definition.rb

Overview

RequestLogAnalyzer is the base namespace in which all functionality of RequestLogAnalyzer is implemented. This module itselfs contains some functions to help with class and source file loading. The actual application startup code resides in the Controller class.

The VERSION constant can be used to determine what version of request-log-analyzer is running.

Defined Under Namespace

Modules: Aggregator, FileFormat, Filter, Output, Source, Tracker Classes: Controller, Database, LineDefinition, LogProcessor, Mailer, Request

Constant Summary

VERSION =
"1.12.11"

Class Method Summary (collapse)

Class Method Details

+ (String) to_camelcase(str)

Convert a string/symbol in underscores (request_log_analyzer/controller) to camelcase (Controller). This can be used to find the class that is defined in a given filename.



28
29
30
# File 'lib/request_log_analyzer.rb', line 28

def self.to_camelcase(str)
  str.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
end

+ (String) to_underscore(str)

Convert a string/symbol in camelcase (Controller) to underscores (request_log_analyzer/controller). This function can be used to load the file (using require) in which the given constant is defined.



18
19
20
# File 'lib/request_log_analyzer.rb', line 18

def self.to_underscore(str)
  str.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase
end