Skip to content
Browse files

Fixing config loading example for Rails

  • Loading branch information...
1 parent dcfcd48 commit ce2d6c8cdc0e73d7ae92241f019f46586788e9ac @jkamenik jkamenik committed Feb 16, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 examples/ruby_example2.rb
View
5 examples/ruby_example2.rb
@@ -74,11 +74,10 @@ def self.send(data, sample_rate=1)
end
end
- @@config = {}
def self.config
- return @@config if @@config
+ return @@config if self.class_variable_defined?(:@@config)
begin
- config_path = File.join(File.dir(__FILE__), "statsd.yml")
+ config_path = File.join(File.dirname(__FILE__), "statsd.yml")
# for Rails environments, check Rails.root/config/statsd.yml
if defined? Rails
config_path = File.join(Rails.root, "config", "statsd.yml")

0 comments on commit ce2d6c8

Please sign in to comment.
Something went wrong with that request. Please try again.