Sha256: 0df512c332f83ce84caccf07dd79bf73613346440769c6d834beafc7482215eb

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'fiveruns/dash/merb/recipe'

module Fiveruns::Dash
  module Merb
    
    def self.start
      ::Fiveruns::Dash.logger.info "Starting FiveRuns Dash"
      Fiveruns::Dash.start(:app => ::Merb::Config[:dash][:token]) do |config|
        Array(::Merb::Config[:dash][:recipes]).each do |set|
          name, options = Array(set)
          ::Fiveruns::Dash.logger.debug "Adding FiveRuns Dash recipe: #{set.inspect}"
          config.add_recipe(name, options)
        end
      end
    end
    
    def self.autoadd_orm
      return if !::Merb.orm || !::Merb::Config[:dash][:autoadd_orm]
      require "fiveruns-dash-#{::Merb.orm}"
      ::Merb::Config[:dash][:recipes].push([
        ::Merb.orm,
        {
          :url => 'http://dash.fiveruns.com',
          :total_time => 'response_time'
        }
      ])
      Fiveruns::Dash.logger.info "Auto-added recipe for ORM from fiveruns-dash-#{::Merb.orm}"
    rescue LoadError
      Fiveruns::Dash.logger.warn "Could not auto-add recipe for ORM from fiveruns-dash-#{::Merb.orm}"
    end
      
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fiveruns-dash-merb-0.8.0 lib/fiveruns/dash/merb.rb
fiveruns-dash-merb-0.8.2 lib/fiveruns/dash/merb.rb