formatted-metrics 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/metrics/configuration.rb +5 -3
- data/lib/metrics/handler.rb +1 -1
- data/lib/metrics/version.rb +1 -1
- data/spec/metrics/handler_spec.rb +2 -2
- metadata +3 -3
@@ -1,7 +1,9 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
1
3
|
module Metrics
|
2
4
|
class Configuration
|
3
5
|
# The stream source to write to. Defaults to STDOUT.
|
4
|
-
attr_accessor :
|
6
|
+
attr_accessor :logger
|
5
7
|
|
6
8
|
# The base source for all metrics.
|
7
9
|
attr_accessor :source
|
@@ -10,8 +12,8 @@ module Metrics
|
|
10
12
|
# Defaults to Metrics::Formatter.
|
11
13
|
attr_accessor :formatter
|
12
14
|
|
13
|
-
def
|
14
|
-
@
|
15
|
+
def logger
|
16
|
+
@logger ||= Logger.new(STDOUT)
|
15
17
|
end
|
16
18
|
|
17
19
|
def source
|
data/lib/metrics/handler.rb
CHANGED
data/lib/metrics/version.rb
CHANGED
@@ -19,7 +19,7 @@ describe Metrics::Handler do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'should handle the event' do
|
22
|
-
Metrics.configuration.
|
22
|
+
Metrics.configuration.logger.should_receive(:info).with(formatter.to_s)
|
23
23
|
handler.handle
|
24
24
|
end
|
25
25
|
end
|
@@ -30,7 +30,7 @@ describe Metrics::Handler do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should not handle the event' do
|
33
|
-
Metrics.configuration.
|
33
|
+
Metrics.configuration.logger.should_receive(:info).never
|
34
34
|
handler.handle
|
35
35
|
end
|
36
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formatted-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
segments:
|
120
120
|
- 0
|
121
|
-
hash:
|
121
|
+
hash: -222700962524494788
|
122
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
123
|
none: false
|
124
124
|
requirements:
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: -222700962524494788
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
133
|
rubygems_version: 1.8.23
|