Module: RequestLogAnalyzer
- Defined in:
- lib/request_log_analyzer.rb,
lib/request_log_analyzer/mailer.rb,
lib/request_log_analyzer/request.rb,
lib/request_log_analyzer/version.rb,
lib/request_log_analyzer/controller.rb,
lib/request_log_analyzer/log_processor.rb,
lib/request_log_analyzer/line_definition.rb,
lib/request_log_analyzer/class_level_inheritable_attributes.rb
Overview
RequestLogAnalyzer is the base namespace in which all functionality of RequestLogAnalyzer is implemented. This module itself 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, ClassLevelInheritableAttributes, FileFormat, Filter, Output, Source, Tracker Classes: Controller, Database, LineDefinition, LogProcessor, Mailer, Request
Constant Summary collapse
- VERSION =
'1.13.4'
Class Method Summary collapse
-
.to_camelcase(str) ⇒ String
Convert a string/symbol in underscores (
request_log_analyzer/controller) to camelcase (Controller). -
.to_underscore(str) ⇒ String
Convert a string/symbol in camel case (Controller) to underscores (
request_log_analyzer/controller).
Class Method Details
.to_camelcase(str) ⇒ String
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.
26 27 28 |
# File 'lib/request_log_analyzer.rb', line 26 def self.to_camelcase(str) str.to_s.gsub(/\/(.?)/) { '::' + Regexp.last_match[1].upcase }.gsub(/(^|_)(.)/) { Regexp.last_match[2].upcase } end |
.to_underscore(str) ⇒ String
Convert a string/symbol in camel case (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.
16 17 18 |
# File 'lib/request_log_analyzer.rb', line 16 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 |