yuslow 0.1.1 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 676d25fa230b9eed3bd3f674cb4a33641748034d0bab29ded6c7be35651c7014
4
- data.tar.gz: 844a69e4bd5eaaad8ff7f2686ccce43a11a8c68490418659273c591b57ae357d
3
+ metadata.gz: 8f013ecce83cd75d707b225ad951b479932b0281ef28c73a058e5488edac16c4
4
+ data.tar.gz: 761d692cfcc1d9fdbef5f46d00ace16a96ac37ec4b4ce869166a8eebde64fc47
5
5
  SHA512:
6
- metadata.gz: 4a85832af47a70ad676c382b6de75b74f67ecb3b3407b0e59c9387b4c92ab9a05aec28977e53845f689db4b75205111dd2f2a5f2c0e1b2b48d996343f0fcd900
7
- data.tar.gz: 568902762d45633c06185df84ab58d3473947050d52ae58069f31c050e598901819608f2c8bd1e40870fc65c725da803ff5a6ec74a830ef1d4dcc28a65620953
6
+ metadata.gz: 77d7aa3fb85e7bfea2a8a698abf1c8161bc8940b63faac868cb947699ee8c63691119a1c308c08f7cdd799cbf890af5736058de3c7ec72c9a1cf35be687abd37
7
+ data.tar.gz: 65db2929fcd268a555ff31cab72a1e0906aeea6e7d90a8f051d5fddd06ca796eac84bf1f41fc0b14995a9cccf2045c3ea38484512d6e19a4061e38480aebaf90
data/README.md CHANGED
@@ -17,7 +17,7 @@ require 'yuslow'
17
17
  then add
18
18
 
19
19
  ```ruby
20
- Yuslow.run do
20
+ Yuslow.investigate do
21
21
  a_very_slow_method
22
22
  end
23
23
  ```
@@ -5,14 +5,15 @@ require_relative 'yuslow/stdout_printer'
5
5
  module Yuslow
6
6
  extend self
7
7
 
8
- def run(debug: false, output: nil, max_depth: nil)
8
+ def investigate(debug: false, output: nil, max_depth: nil)
9
9
  raise 'Block expected' unless block_given?
10
10
 
11
11
  investigation = Investigation.new debug: debug, printer: printer_from(output), max_depth: max_depth
12
12
  investigation.start
13
- yield
13
+ result = yield
14
14
  investigation.finish
15
15
  investigation
16
+ result
16
17
  end
17
18
 
18
19
  def investigation(debug: false, output: nil, max_depth: nil)
@@ -28,7 +28,7 @@ module Yuslow
28
28
  output << "#{indentation}#{identifier} elapsed #{elapsed} ms"
29
29
  else
30
30
  text = "#{operation.identifier} did not finish"
31
- colorize(text, :yellow) if colorize
31
+ text = colorize(text, :yellow) if colorize
32
32
 
33
33
  output << "#{indentation}#{text}"
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuslow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deyan Dobrinov