From 5e1fd84bcf6524b10f02caf00de1968452d72523 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 12 Apr 2007 14:23:29 +0000 Subject: Define pretty_inspect for the older version of Ruby that don't have it --- lib/rbot/ircbot.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/rbot') diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index a08dae9f..3ef58a38 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -15,6 +15,13 @@ $logger.level = 0 if $debug require 'pp' +unless Kernel.instance_methods.include?("pretty_inspect") + def pretty_inspect + PP.pp(self, '') + end + public :pretty_inspect +end + class Exception def pretty_print(q) q.group(1, "#<%s: %s" % [self.class, self.message], ">") { -- cgit v1.2.3