Project

General

Profile

Feature #2018 ยป basicobject_irb.patch

Patch for catching inspect exception in irb - DanielBovensiepen (Daniel Bovensiepen), 08/31/2009 02:43 AM

View differences:

lib/irb/inspector.rb (working copy)
81 81
  end
82 82

  
83 83
  INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s}
84
  INSPECTORS.def_inspector([true, :p, :inspect]){|v| v.inspect}
84
  INSPECTORS.def_inspector([true, :p, :inspect]){|v| 
85
    begin
86
      v.inspect
87
    rescue NoMethodError
88
      puts "(Object doesn't support inspect)"
89
    end
90
  }
85 91
  INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp}
86 92
  INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v| 
87 93
    begin