Sha256: ed71f3c5436fb1a0239f40b03c0b045579e5355e629c6cbe1d800aa682d68da6
Contents?: true
Size: 1.02 KB
Versions: 8
Compression:
Stored size: 1.02 KB
Contents
# -*- coding: utf-8 -*- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net> require 'rubygems'; require 'require_relative' require_relative '../../base/subsubcmd' class Trepan::Subcommand::SetAutoList < Trepan::SetBoolSubSubcommand unless defined?(HELP) HELP = "Set to run a 'list' command each time we enter the debugger" MIN_ABBREV = 'l'.size NAME = File.basename(__FILE__, '.rb') PREFIX = %w(set auto list) SHORT_HELP = "Set running a 'list' command each time we enter the debugger" end def run(args) super if @proc.settings[:autolist] @proc.cmdloop_prehooks.insert_if_new(10, *@proc.autolist_hook) else @proc.cmdloop_prehooks.delete_by_name('autolist') end end end if __FILE__ == $0 # Demo it. require_relative '../../../mock' require_relative '../auto' cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::SetAuto, Trepan::SubSubcommand::SetAutoList) cmd.run([cmd.name, 'off']) cmd.run([cmd.name, 'on']) end
Version data entries
8 entries across 8 versions & 1 rubygems