Sha256: ef0b3b58f0ced2f2ddd5bfe294d7c2bc26bf133201af100e42897d8a469d9f3c

Contents?: true

Size: 1.51 KB

Versions: 18

Compression:

Stored size: 1.51 KB

Contents

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

class Trepan::SubSubcommand::ShowMaxString < Trepan::ShowIntSubSubcommand
  unless defined?(HELP)
    HELP = 'Show the number of characters in a string before truncating.

Sometimes the string representation of an object is very long. This
setting limits how much of the string representation you want to
see. However if the string has an embedded newline then we will assume
the output is intended to be formated as.'
    MIN_ABBREV   = 'st'.size
    NAME         = File.basename(__FILE__, '.rb')
    PREFIX       = %w(show max string)
  end

end

if __FILE__ == $0
  # Demo it.
  require_relative '../../../mock'

  # FIXME: DRY the below code
  dbgr, show_cmd = MockDebugger::setup('show')
  testcmdMgr     = Trepan::Subcmd.new(show_cmd)
  # max_cmd        = Trepan::SubSubcommand::ShowMax.new(dbgr.core.processor, 
  #                                                     show_cmd)
  
  # cmd_name       = Trepan::SubSubcommand::ShowMaxString::PREFIX.join('')
  # maxx_cmd       = Trepan::SubSubcommand::ShowMaxString.new(show_cmd.proc,
  #                                                           max_cmd,
  #                                                           cmd_name)

  # # require_relative '../../../../lib/trepanning'
  # # dbgr = Trepan.new(:set_restart => true)
  # # dbgr.debugger
  puts max_cmd.summary_help(maxx_cmd)
  puts 
  maxx_cmd.run([])
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.6 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.5 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.4 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.3 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 processor/command/show_subcmd/max_subcmd/string.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.7-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.6-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.5-universal-rubinius-1.2.1 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.4-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.3-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.2-universal-rubinius-1.2 processor/command/show_subcmd/max_subcmd/string.rb
rbx-trepanning-0.0.1-universal-rubinius processor/command/show_subcmd/max_subcmd/string.rb