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.
- data/lib/statsd.rb +7 -1
- data/spec/statsd_spec.rb +12 -0
- data/statsd-ruby.gemspec +1 -1
- metadata +4 -4
data/lib/statsd.rb
CHANGED
@@ -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
|
-
|
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
|
data/spec/statsd_spec.rb
CHANGED
@@ -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)}
|
data/statsd-ruby.gemspec
CHANGED
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:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
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:
|
18
|
+
date: 2013-01-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|