module SpeedupDashboard

Constants

VERSION

Public Instance Methods

analyze(request) click to toggle source
# File lib/speedup-dashboard.rb, line 14
def analyze(request)
  @analyzers.each do |analyzer|
    analyzer.analyze(request)
  end
end
analyzers() click to toggle source

array of arrays

# File lib/speedup-dashboard.rb, line 6
def analyzers
  @analyzer_options ||= []
end
initialize_analyzers!() click to toggle source
# File lib/speedup-dashboard.rb, line 10
def initialize_analyzers!
  @analyzers = @analyzer_options.map{|analyzer| initialize_analyzer(*analyzer) }
end

Private Instance Methods

initialize_analyzer(analyzer, *parameters) click to toggle source
# File lib/speedup-dashboard.rb, line 22
def initialize_analyzer(analyzer, *parameters)
  @analyzer = case analyzer
  when Symbol
    analyzer_class_name = analyzer.to_s.camelize
    analyzer_class =
      begin
        require "speedup/analyzers/#{analyzer}"
      rescue LoadError => e
        raise "Could not find analyzer for #{analyzer} (#{e})"
      else
        Speedup::Analyzers.const_get(analyzer_class_name)
      end
    analyzer_class.new(*parameters)
  when :all
    # initialize all
  else
    analyzer
  end

  @analyzer
end