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)
end
INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s}
INSPECTORS.def_inspector([true, :p, :inspect]){|v| v.inspect}
INSPECTORS.def_inspector([true, :p, :inspect]){|v|
begin
v.inspect
rescue NoMethodError
puts "(Object doesn't support inspect)"
end
}
INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp}
INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v|
begin
    (1-1/1)