Class: Lineprof

Inherits:
Object
  • Object
show all
Defined in:
lib/lineprof.rb,
lib/lineprof/version.rb

Constant Summary collapse

IGNORE_PATTERN =
/lib\/lineprof\.rb$/
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.profile(&block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/lineprof.rb', line 8

def profile(&block)
  value = nil
  result = lineprof(/./) { value = block.call }

  puts Term::ANSIColor.blue("\n[Lineprof] #{'=' * 70}")
  puts "\n#{format(result)}\n"
  value
end