diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-12 14:23:29 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-12 14:23:29 +0000 |
commit | 5e1fd84bcf6524b10f02caf00de1968452d72523 (patch) | |
tree | 0ebb598a5e91257feb9daec29733476ab1332b54 /lib/rbot | |
parent | 46f1fd3ae3aaecbbc36b987e356393500431d498 (diff) |
Define pretty_inspect for the older version of Ruby that don't have it
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/ircbot.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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], ">") { |