Class: PuppetDebugger::InputResponders::Benchmark

Inherits:
PuppetDebugger::InputResponderPlugin show all
Defined in:
lib/plugins/puppet-debugger/input_responders/benchmark.rb

Constant Summary collapse

COMMAND_WORDS =
%w(benchmark bm)
SUMMARY =
'Benchmark your Puppet code.'
COMMAND_GROUP =
:tools

Instance Attribute Summary

Attributes inherited from PuppetDebugger::InputResponderPlugin

#debugger

Instance Method Summary collapse

Methods inherited from PuppetDebugger::InputResponderPlugin

command_completion, command_group, command_words, details, execute, #modules_paths, #puppet_debugger_lib_dir, summary

Instance Method Details

#run(args = []) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/plugins/puppet-debugger/input_responders/benchmark.rb', line 10

def run(args = [])
  if args.count > 0
    enable(false)
    out = debugger.handle_input(args.first)
    disable
    out
  else
    status = debugger.bench ? disable : enable(true)
    "Benchmark Mode #{status}"
  end
end