Sha256: ab90b7fb833a528ae400a664de1e78b419ea8927feaf706f5d6038b967d06421
Contents?: true
Size: 969 Bytes
Versions: 5
Compression:
Stored size: 969 Bytes
Contents
# -*- coding: utf-8 -*- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net> require_relative '../../base/subsubcmd' class Trepan::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand unless defined?(HELP) HELP = "Set to automatically go into irb each time we enter the debugger" MIN_ABBREV = 'ir'.size NAME = File.basename(__FILE__, '.rb') PREFIX = %W(set auto #{NAME}) end def run(args) super if @proc.settings[:autoirb] @proc.cmdloop_prehooks.insert_if_new(-1, *@proc.autoirb_hook) else @proc.cmdloop_prehooks.delete_by_name('autoirb') end end end if __FILE__ == $0 # Demo it. require_relative '../../../mock' require_relative '../auto' cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::SetAuto, Trepan::SubSubcommand::SetAutoIrb) %w(off on 0 1).each { |arg| cmd.run([cmd.name, arg]) } puts '-' * 10 puts cmd.save_command.join("\n") end
Version data entries
5 entries across 5 versions & 1 rubygems