ruby_reportable 0.3.0 → 0.3.1

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: b04f619cf3775ffacbf265722b9f168f43d88702
4
- data.tar.gz: d3f891c8f6d3be584b5c1895b8bffb8181faf3fa
3
+ metadata.gz: 0ce6c1156d97b85a115a1da80e42bfcc8e42b412
4
+ data.tar.gz: 7585d34ffae9d66e8b1e929ee2ddb4b635acaf7b
5
5
  SHA512:
6
- metadata.gz: 9ee540862f28daed7fa72d27ec7d7434041c58bf1d2f27e7e088f81d54db7232b0a5c1d98fe9007f111eb77c359362bd4ef48e63c093e203768c093980b78e7e
7
- data.tar.gz: 1c981b6af75c60f80ec14e2753f132027ec222eb5c0ac7d920878d5e8e5ab383fa1a88590908099a5c0abe775614352167594836dc4db856cddf12854611cceb
6
+ metadata.gz: f20eab08a891aba3b2239e607639dbe60eb5cb2acbc82099a06d01c35d51c3b132852781d072ba03f2e3a9127557668fa305a4a8926a73aa7a2581c36a7e29f5
7
+ data.tar.gz: 147774a281b825ce2a0713b1a18bbbdb2e0104aefcd45fa67c1a0af682d78e7f4eb92ccbf8a245807b0cceaaba6faf6209e09fcb372d45642ff20760d5475acb
@@ -21,7 +21,15 @@ module RubyReportable
21
21
 
22
22
  def benchmark(name)
23
23
  benchmarks[name] ||= 0.0
24
- benchmarks[name] += (Benchmark.realtime { yield if block_given? } * 1000)
24
+
25
+ @result = nil
26
+
27
+ time = Benchmark.realtime do
28
+ @result = yield
29
+ end
30
+
31
+ benchmarks[name] += time
32
+ @result
25
33
  end
26
34
 
27
35
  def meta(key, value = nil, &block)
@@ -171,28 +179,28 @@ module RubyReportable
171
179
  options = {:input => {}}.merge(options)
172
180
 
173
181
  # initial sandbox
174
- benchmark(:sandbox) do
175
- sandbox = _source(options)
182
+ sandbox = benchmark(:sandbox) do
183
+ _source(options)
176
184
  end
177
185
 
178
186
  # apply filters to source
179
- benchmark(:filters) do
180
- filtered_sandbox = _data(sandbox, options)
187
+ filtered_sandbox = benchmark(:filters) do
188
+ _data(sandbox, options)
181
189
  end
182
190
 
183
191
  # finalize raw data from source
184
- benchmark(:finalize) do
185
- source_data = _finalize(filtered_sandbox, options).source
192
+ source_data = benchmark(:finalize) do
193
+ _finalize(filtered_sandbox, options).source
186
194
  end
187
195
 
188
196
  # {:default => [{outputs => values}]
189
- benchmark(:output) do
190
- data = _output(source_data, options)
197
+ data = benchmark(:output) do
198
+ _output(source_data, options)
191
199
  end
192
200
 
193
201
  # transform into {group => [outputs => values]}
194
- benchmark(:group) do
195
- grouped = _group(options[:group], data, options)
202
+ grouped = benchmark(:group) do
203
+ _group(options[:group], data, options)
196
204
  end
197
205
 
198
206
  # sort grouped data
@@ -1,3 +1,3 @@
1
1
  module RubyReportable
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_reportable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John 'asceth' Long