]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
attempt workaround for missing load_file
authorTom Gilbert <tom@linuxbrit.co.uk>
Sun, 7 Aug 2005 16:27:13 +0000 (16:27 +0000)
committerTom Gilbert <tom@linuxbrit.co.uk>
Sun, 7 Aug 2005 16:27:13 +0000 (16:27 +0000)
lib/rbot/config.rb

index 957c63a3fd68966bef5f40d5667e52d3a475f602..5af50f346b3eb849d5a09546318f009712c9bf01 100644 (file)
@@ -3,6 +3,16 @@ module Irc
   require 'yaml'
   require 'rbot/messagemapper'
 
+  unless YAML.respond_to?(:load_file)
+    module YAML
+      def YAML.load_file( filepath )
+        File.open( filepath ) do |f|
+          YAML::load( f )
+        end
+      end
+    end
+  end
+
   class BotConfigValue
     # allow the definition order to be preserved so that sorting by
     # definition order is possible. The BotConfigWizard does this to allow