]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/games/shiritori.rb
refactor: wordlist shouldn't use bot singleton #35
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / games / shiritori.rb
index 3cb3c7b5c3056e7f68e273142043f86b6451b46b..9ca23f9a264af5e299e54c2cf55041c07f8e7c8a 100644 (file)
@@ -389,9 +389,8 @@ class ShiritoriPlugin < Plugin
     unless ruleset.has_key?(:words)
       if ruleset.has_key?(:wordlist_file)
         begin
-          ruleset[:words] =
-            File.new(datafile(ruleset[:wordlist_file])).grep(
-              ruleset[:listen]) {|l| ruleset[:normalize].call l.chomp}
+          ruleset[:words] = Wordlist.get(@bot, ruleset[:wordlist_file], :spaces => true)
+            .grep(ruleset[:listen]) {|l| ruleset[:normalize].call l.chomp}
         rescue
           raise "unable to load word list"
         end