]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Define pretty_inspect for the older version of Ruby that don't have it
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 12 Apr 2007 14:23:29 +0000 (14:23 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 12 Apr 2007 14:23:29 +0000 (14:23 +0000)
lib/rbot/ircbot.rb

index a08dae9f84bd23d8bb0452ac383aa283d27a058d..3ef58a38c2fdf440eb08dd3686d410254367f3fd 100644 (file)
@@ -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], ">") {