diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-23 16:46:28 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-23 16:46:28 +0000 |
commit | ef4d643889556a58f989a0d72278c81218036292 (patch) | |
tree | 8695f91303f939a73be1c22155efea8b1c7deba7 /data | |
parent | e1b39090cb10bb7c6211789450ecad8a81e241f2 (diff) |
More lart plugins cleanup
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/lart.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/data/rbot/plugins/lart.rb b/data/rbot/plugins/lart.rb index 69a9e8cc..2f470c96 100644 --- a/data/rbot/plugins/lart.rb +++ b/data/rbot/plugins/lart.rb @@ -47,19 +47,23 @@ class LartPlugin < Plugin def set_language(lang) save + + # We may be on an old installation, so on the first run read non-language-specific larts + unless defined?(@oldlart) + @oldlart = "#{@bot.botclass}/lart/larts" + @oldpraise = "#{@bot.botclass}/lart/praise" + end + @lartfile.replace "#{@bot.botclass}/lart/larts-#{lang}" @praisefile.replace "#{@bot.botclass}/lart/praises-#{lang}" - # We may be on an old installation, so on the first run read non-language-specific larts - @bulart.replace "#{@bot.botclass}/lart/larts" - @bupraise.replace "#{@bot.botclass}/lart/praise" @larts.clear @praises.clear if File.exists? @lartfile IO.foreach(@lartfile) { |line| @larts << line.chomp } - elsif File.exists? @bulart - IO.foreach(@bulart) { |line| + elsif File.exists? @oldlart + IO.foreach(@oldlart) { |line| @larts << line.chomp } end @@ -67,8 +71,8 @@ class LartPlugin < Plugin IO.foreach(@praisefile) { |line| @praises << line.chomp } - elsif File.exists? @bupraise - IO.foreach(@bupraise) { |line| + elsif File.exists? @oldpraise + IO.foreach(@oldpraise) { |line| @praises << line.chomp } end |