]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Load the 1.9 compatibility code earlier
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 12 Jan 2011 20:06:27 +0000 (21:06 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 12 Jan 2011 20:06:27 +0000 (21:06 +0100)
The compat19 code touches the monitor mixins which are used by the
logger which is started as soon as ircbot.rb is loaded. To make sure the
logger uses the compat code we must load compat19 before ircbot.

bin/rbot

index 2e460e337d5bce8c119d67126edbc73f61cb5250..06e6db306dc4b22699f0d2191604280818b82228 100755 (executable)
--- a/bin/rbot
+++ b/bin/rbot
@@ -89,8 +89,13 @@ if File.directory? "#{defaultlib}/rbot"
     $:.unshift defaultlib
   end
 end
-  
+
 begin
+  # ruby 1.9 specific fixes
+  unless RUBY_VERSION < '1.9'
+    require 'rbot/compat19'
+  end
+
   require 'rbot/ircbot'
 rescue LoadError => e
   puts "Error: couldn't find the rbot/ircbot module (or one of its dependencies)\n"
@@ -98,11 +103,6 @@ rescue LoadError => e
   exit 2
 end
 
-# ruby 1.9 specific fixes
-unless RUBY_VERSION < '1.9'
-  require 'rbot/compat19'
-end
-
 if ($opts["version"])
   puts "rbot #{$version}"
   exit 0