]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/quotes.rb
Revert the Struct.new-related changes because they don't do what we want
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / quotes.rb
index e08d8f9ac4ec83b61c368614eb88852cdd119063..390b98f7077aa6753ef7a4e5013baeef2cf17fb0 100644 (file)
@@ -1,12 +1,13 @@
 # GB: Ok, we *really* need to switch to db for this plugin too
 
-Quote = Struct.new("Quote", "num", "date", "source", "quote")
+Quote = Struct.new("Quote", :num, :date, :source, :quote)
 
 class QuotePlugin < Plugin
   def initialize
     super
     @lists = Hash.new
     Dir["#{@bot.botclass}/quotes/*"].each {|f|
+      next if File.directory?(f)
       channel = File.basename(f)
       @lists[channel] = Array.new if(!@lists.has_key?(channel))
       IO.foreach(f) {|line|
@@ -32,9 +33,9 @@ class QuotePlugin < Plugin
         File.rename("#{@bot.botclass}/quotes/new/#{channel}",
                     "#{@bot.botclass}/quotes/#{channel}")
       rescue => e
-        $stderr.puts "failed to write quotefile for channel #{channel}!\n#{$!}"
-        debug "#{e.class}: #{e}"
-        debug e.backtrace.join("\n")
+        error "failed to write quotefile for channel #{channel}!\n#{$!}"
+        error "#{e.class}: #{e}"
+        error e.backtrace.join("\n")
       end
     }
   end