class PuppetDebugger::InputResponders::Benchmark

Constants

COMMAND_GROUP
COMMAND_WORDS
SUMMARY

Public Instance Methods

run(args = []) click to toggle source
# File lib/plugins/puppet-debugger/input_responders/benchmark.rb, line 12
def run(args = [])
  if args.count.positive?
    enable(false)
    out = debugger.handle_input(args.first)
    disable
    out
  else
    status = debugger.bench ? disable : enable(true)
    "Benchmark Mode #{status}"
  end
end

Private Instance Methods

disable() click to toggle source
# File lib/plugins/puppet-debugger/input_responders/benchmark.rb, line 26
def disable
  debugger.bench = false
  debugger.extra_prompt = ''
  'Off'
end
enable(show_status = false) click to toggle source
# File lib/plugins/puppet-debugger/input_responders/benchmark.rb, line 32
def enable(show_status = false)
  debugger.bench = true
  if show_status
    debugger.extra_prompt = 'BM'
    'On'
  end
end