Class: SpeedGun::Profiler::LineProfiler
- Inherits:
-
SpeedGun::Profiler
- Object
- SpeedGun::Profiler
- SpeedGun::Profiler::LineProfiler
- Defined in:
- lib/speed_gun/profiler/line_profiler.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SpeedGun::Profiler
Class Method Details
.regexp ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/speed_gun/profiler/line_profiler.rb', line 7 def self.regexp if SpeedGun.config.lineprof_paths.empty? %r{.} else Regexp.union(*SpeedGun.config.lineprof_paths) end end |
Instance Method Details
#profile(*_args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/speed_gun/profiler/line_profiler.rb', line 15 def profile(*_args) return yield if self.class.ignore? result = nil lineprofiled = lineprof(self.class.regexp) do result = yield end store(lineprofiled) if SpeedGun.current_report result end |