statsd-ruby 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,8 +123,14 @@ class Statsd
123
123
  @prefix = "#{namespace}."
124
124
  end
125
125
 
126
+ # @attribute [w] postfix
127
+ # A value to be appended to the stat name after a '.'. If the value is
128
+ # blank then the postfix will be reset to nil (rather than to '.').
126
129
  def postfix=(pf)
127
- @postfix = ".#{pf}"
130
+ case pf
131
+ when nil, false, '' then @postfix = nil
132
+ else @postfix = ".#{pf}"
133
+ end
128
134
  end
129
135
 
130
136
  # @attribute [w] host
@@ -213,6 +213,18 @@ describe Statsd do
213
213
  end
214
214
  end
215
215
 
216
+ describe '#postfix=' do
217
+ describe "when nil, false, or empty" do
218
+ it "should set postfix to nil" do
219
+ [nil, false, ''].each do |value|
220
+ @statsd.postfix = 'a postfix'
221
+ @statsd.postfix = value
222
+ @statsd.postfix.must_equal nil
223
+ end
224
+ end
225
+ end
226
+ end
227
+
216
228
  describe "with logging" do
217
229
  require 'stringio'
218
230
  before { Statsd.logger = Logger.new(@log = StringIO.new)}
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- Gem::Specification.new("statsd-ruby", "1.1.0") do |s|
3
+ Gem::Specification.new("statsd-ruby", "1.1.1") do |s|
4
4
  s.authors = ["Rein Henrichs"]
5
5
  s.email = "rein@phpfog.com"
6
6
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsd-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rein Henrichs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-05 00:00:00 Z
18
+ date: 2013-01-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest