fiveruns-dash-merb 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :patch: 0
3
3
  :major: 0
4
- :minor: 7
4
+ :minor: 8
@@ -7,12 +7,27 @@ module Fiveruns::Dash
7
7
  ::Fiveruns::Dash.logger.info "Starting FiveRuns Dash"
8
8
  Fiveruns::Dash.start(:app => ::Merb::Config[:dash][:token]) do |config|
9
9
  Array(::Merb::Config[:dash][:recipes]).each do |set|
10
- name, url = Array(set)
10
+ name, options = Array(set)
11
11
  ::Fiveruns::Dash.logger.debug "Adding FiveRuns Dash recipe: #{set.inspect}"
12
- config.add_recipe(name, :url => url)
12
+ config.add_recipe(name, options)
13
13
  end
14
14
  end
15
15
  end
16
+
17
+ def self.autoadd_orm
18
+ return if !::Merb.orm || !::Merb::Config[:dash][:autoadd_orm]
19
+ require "fiveruns-dash-#{::Merb.orm}"
20
+ ::Merb::Config[:dash][:recipes].push([
21
+ ::Merb.orm,
22
+ {
23
+ :url => 'http://dash.fiveruns.com',
24
+ :total_time => 'response_time'
25
+ }
26
+ ])
27
+ Fiveruns::Dash.logger.info "Auto-added recipe for ORM from fiveruns-dash-#{::Merb.orm}"
28
+ rescue LoadError
29
+ Fiveruns::Dash.logger.warn "Could not auto-add recipe for ORM from fiveruns-dash-#{::Merb.orm}"
30
+ end
16
31
 
17
32
  end
18
33
  end
@@ -1,18 +1,21 @@
1
1
  # Depends on non-ActiveSupport fiveruns-dash-ruby (>= 0.8.0)
2
2
  dependency 'fiveruns-dash-ruby', '>= 0.8.0', :require_as => 'fiveruns/dash',
3
3
  :immediate => true
4
+
4
5
  Merb::Config[:dash] ||= {
5
6
  :token => nil,
7
+ :autoadd_orm => true,
6
8
  :recipes => [
7
9
  # This recipe can be removed, if desired
8
- [:merb, 'http://dash.fiveruns.com']
10
+ [:merb, {:url => 'http://dash.fiveruns.com'}]
9
11
  ]
10
12
  }
11
13
 
12
14
  Merb::BootLoader.after_app_loads do
13
- Fiveruns::Dash.logger = Merb.logger
14
15
  require 'fiveruns/dash/merb'
15
16
  if Merb::Config[:adapter] != 'irb' && Merb::Config[:dash][:token]
17
+ Fiveruns::Dash.logger = Merb.logger
18
+ Fiveruns::Dash::Merb.autoadd_orm
16
19
  Fiveruns::Dash::Merb.start
17
20
  end
18
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiveruns-dash-merb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FiveRuns Development Team
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-20 00:00:00 -08:00
12
+ date: 2009-02-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency