formatted-metrics 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metrics.rb +1 -1
- data/lib/metrics/handler.rb +8 -1
- data/lib/metrics/version.rb +1 -1
- data/spec/metrics/instrumentable_spec.rb +4 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6923ec5b6c8b2e14c32331e4aec3c3ad4cd3793
|
4
|
+
data.tar.gz: ce3df73217abdced94bec03c795a2386c1971f8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec73bc12f3f909b6be0428649ae4bb70f6db0a286594abdd4441b5aa474ab76180a81d38454a9e6468a64edda3d218bb22fcfea8bf2701f17483d8f803a9c505
|
7
|
+
data.tar.gz: 245eec39d24b9f17da8ddcca8779791b1b338f33d09c17c09f4bd3458cdfc039390dd293796fa11359fb2c6f8f96c42461e15c300bdcb64bc88f77cf6fad2ef6
|
data/lib/metrics.rb
CHANGED
data/lib/metrics/handler.rb
CHANGED
@@ -17,10 +17,17 @@ module Metrics
|
|
17
17
|
#
|
18
18
|
# Returns an Array of Metrics::Instrumenters that were written.
|
19
19
|
def handle
|
20
|
-
|
20
|
+
write(*instrumenters)
|
21
|
+
return last_result
|
21
22
|
end
|
22
23
|
|
23
24
|
private
|
25
|
+
# The result of the last instrumenter. This is the return value of the
|
26
|
+
# block being instrumented.
|
27
|
+
def last_result
|
28
|
+
instrumenters.last.result
|
29
|
+
end
|
30
|
+
|
24
31
|
def write(*instrumenters)
|
25
32
|
driver.write(*instrumenters)
|
26
33
|
end
|
data/lib/metrics/version.rb
CHANGED
@@ -33,6 +33,10 @@ describe Metrics::Instrumentable do
|
|
33
33
|
expect(klass.new.long_method).to eq 'foo'
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'returns the return value of the original method' do
|
37
|
+
expect(klass.new.long_method).to eq 'foo'
|
38
|
+
end
|
39
|
+
|
36
40
|
it 'sets the visibility of protected methods' do
|
37
41
|
expect(klass.public_method_defined?(:long_method)).to be_true
|
38
42
|
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: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric J. Holmes
|
@@ -143,3 +143,4 @@ test_files:
|
|
143
143
|
- spec/metrics_spec.rb
|
144
144
|
- spec/rack/instrumentation_spec.rb
|
145
145
|
- spec/spec_helper.rb
|
146
|
+
has_rdoc:
|