Sha256: 41c85acfa1746546e85dbdb802961d6d1eb9cb141c54f19c5733a0308cb179eb

Contents?: true

Size: 945 Bytes

Versions: 10

Compression:

Stored size: 945 Bytes

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../../base/subsubcmd'

class Trepan::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand
  unless defined?(HELP)
    Trepanning::Subcommand.set_name_prefix(__FILE__, self)
    HELP = "Set to automatically go into irb each time we enter the debugger"
    MIN_ABBREV = 'ir'.size
  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)
  cmd.run([cmd.name, 'off'])
  cmd.run([cmd.name, 'on'])
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/set_subcmd/auto_subcmd/irb.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/set_subcmd/auto_subcmd/irb.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.6 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.5 processor/command/set_subcmd/auto_subcmd/irb.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.4 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.3 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 processor/command/set_subcmd/auto_subcmd/irb.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 processor/command/set_subcmd/auto_subcmd/irb.rb