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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d33ddd37a5151fefe56beb65c13bd3b9b503efd
4
- data.tar.gz: 0c0eeaecbca51357625094b954838bd77eab512e
3
+ metadata.gz: e6923ec5b6c8b2e14c32331e4aec3c3ad4cd3793
4
+ data.tar.gz: ce3df73217abdced94bec03c795a2386c1971f8b
5
5
  SHA512:
6
- metadata.gz: 34abc4c6d556e752fdf55d975260d1892458ece7f17c1a3228b80c2a0c124ba69664bc3cba9bc11d4648d5b4f830871737df37f1ca92e9617abce8ddbff7923a
7
- data.tar.gz: 6d921f8f040ff949c5b05334bddf7f149ec213b86f54d73b3d5fc43d130ca71861a8d0639612a878449e2cebb2c2f88db78d9c3e9ba45443599b675ef4cb9be0
6
+ metadata.gz: ec73bc12f3f909b6be0428649ae4bb70f6db0a286594abdd4441b5aa474ab76180a81d38454a9e6468a64edda3d218bb22fcfea8bf2701f17483d8f803a9c505
7
+ data.tar.gz: 245eec39d24b9f17da8ddcca8779791b1b338f33d09c17c09f4bd3458cdfc039390dd293796fa11359fb2c6f8f96c42461e15c300bdcb64bc88f77cf6fad2ef6
@@ -47,7 +47,7 @@ module Metrics
47
47
  # yield
48
48
  # end
49
49
  #
50
- # Returns nothing.
50
+ # Returns the return value of the block.
51
51
  def instrument(*args, &block)
52
52
  Handler.handle(Instrumenter.instrument(*args, &block))
53
53
  end
@@ -17,10 +17,17 @@ module Metrics
17
17
  #
18
18
  # Returns an Array of Metrics::Instrumenters that were written.
19
19
  def handle
20
- return write(*instrumenters)
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
@@ -1,3 +1,3 @@
1
1
  module FormattedMetrics
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
@@ -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.1
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: