lib/request_log_analyzer/aggregator/summarizer.rb in request-log-analyzer-1.1.0 vs lib/request_log_analyzer/aggregator/summarizer.rb in request-log-analyzer-1.1.1

- old
+ new

@@ -1,6 +1,6 @@ -require File.dirname(__FILE__) + '/../tracker/base' +require File.dirname(__FILE__) + '/../tracker' module RequestLogAnalyzer::Aggregator class Summarizer < Base @@ -31,11 +31,10 @@ track(:duration, duration_field.merge(options)) end end def track(tracker_klass, options = {}) - require "#{File.dirname(__FILE__)}/../tracker/#{tracker_klass}" - tracker_klass = RequestLogAnalyzer::Tracker.const_get(tracker_klass.to_s.split(/[^a-z0-9]/i).map{ |w| w.capitalize }.join('')) if tracker_klass.kind_of?(Symbol) + tracker_klass = RequestLogAnalyzer::Tracker.const_get(RequestLogAnalyzer::to_camelcase(tracker_klass)) if tracker_klass.kind_of?(Symbol) @trackers << tracker_klass.new(options) end end attr_reader :trackers