babysitter 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,12 +6,12 @@ module Babysitter
6
6
  attr_accessor :log_every
7
7
 
8
8
  def initialize(log_every, stat_name=nil)
9
- @stat_name = stat_name
9
+ @stat_name = stat_name.is_a?(String) ? stat_name.split('.') : stat_name
10
10
  @counting = default_counting
11
11
  @log_every = log_every
12
12
  @timer_start = Time.now
13
13
  @counters = Hash.new do |h, k|
14
- h[k] = Counter.new(log_every, stat_name: stat_name, counting: k, timer_start: timer_start)
14
+ h[k] = Counter.new(log_every, stat_name: @stat_name, counting: k, timer_start: timer_start)
15
15
  end
16
16
  end
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Babysitter
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -11,6 +11,14 @@ module Babysitter
11
11
  Babysitter.stub(:logger).and_return(logger)
12
12
  end
13
13
 
14
+ describe '.new' do
15
+ let(:stat_bucket_prefix) { 'my.stat.bucket.prefix' }
16
+
17
+ it 'converts string stat_name to array' do
18
+ subject.stat_name.should == %w(my stat bucket prefix)
19
+ end
20
+ end
21
+
14
22
  describe '#logger_with_stats_for' do
15
23
 
16
24
  it 'returns the same logger when passed the same symbol twice' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babysitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-01 00:00:00.000000000 Z
15
+ date: 2013-03-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: fozzie