diff options
author | David Gadling <dave@toasterwaffles.com> | 2009-05-21 11:53:19 -0700 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-05-21 22:09:28 +0200 |
commit | 7f244f32d974cafa74f449853f940f194d08d6d2 (patch) | |
tree | b72684ce149254edaf2dba993c409a640cc43086 /data/rbot | |
parent | d8fd18fe30013ba7705aaeb5dd4521cbe013b824 (diff) |
multiple plugins: Changes to remove parenthesize warnings.
All of these modules/plugins were generating warnings like this:
warning: parenthesize argument(s) for future version
This patch should fix all the warnings without affecting functionality.
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/games/shiritori.rb | 2 | ||||
-rw-r--r-- | data/rbot/plugins/keywords.rb | 10 | ||||
-rw-r--r-- | data/rbot/plugins/lart.rb | 4 | ||||
-rw-r--r-- | data/rbot/plugins/quotes.rb | 4 | ||||
-rw-r--r-- | data/rbot/plugins/urban.rb | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/data/rbot/plugins/games/shiritori.rb b/data/rbot/plugins/games/shiritori.rb index 92f4dda4..3cb3c7b5 100644 --- a/data/rbot/plugins/games/shiritori.rb +++ b/data/rbot/plugins/games/shiritori.rb @@ -390,7 +390,7 @@ class ShiritoriPlugin < Plugin if ruleset.has_key?(:wordlist_file) begin ruleset[:words] = - File.new(datafile ruleset[:wordlist_file]).grep( + File.new(datafile(ruleset[:wordlist_file])).grep( ruleset[:listen]) {|l| ruleset[:normalize].call l.chomp} rescue raise "unable to load word list" diff --git a/data/rbot/plugins/keywords.rb b/data/rbot/plugins/keywords.rb index 58fcfe9b..da320780 100644 --- a/data/rbot/plugins/keywords.rb +++ b/data/rbot/plugins/keywords.rb @@ -138,7 +138,7 @@ class Keywords < Plugin # have been added def scan # first scan for old DBHash files, and convert them - Dir[datafile '*'].each {|f| + Dir[datafile('*')].each {|f| next unless f =~ /\.db$/ log "upgrading keyword db #{f} (rbot 0.9.5 or prior) database format" newname = f.gsub(/\.db$/, ".kdb") @@ -153,7 +153,7 @@ class Keywords < Plugin } # then scan for current DBTree files, and load them - Dir[@bot.path 'keywords', '*'].each {|f| + Dir[@bot.path('keywords', '*')].each {|f| next unless f =~ /\.kdb$/ hsh = DBTree.new @bot, f, true key = File.basename(f).gsub(/\.kdb$/, "") @@ -162,7 +162,7 @@ class Keywords < Plugin } # then scan for non DB files, and convert/import them and delete - Dir[@bot.path 'keywords', '*'].each {|f| + Dir[@bot.path('keywords', '*')].each {|f| next if f =~ /\.kdb$/ next if f =~ /CVS$/ log "auto converting keywords from #{f}" @@ -202,7 +202,7 @@ class Keywords < Plugin File.rename(olds, olds + ".old") end - olds.replace(@bot.path 'keyword.db') + olds.replace(@bot.path('keyword.db')) if File.exist? olds log "upgrading old keywords (rbot 0.9.9 or prior) database format" old = BDB::CIBtree.open olds, nil, "r+", 0600 @@ -221,7 +221,7 @@ class Keywords < Plugin end def oldsave - File.open(@bot.path "keywords.rbot", "w") do |file| + File.open(@bot.path("keywords.rbot"), "w") do |file| @keywords.each do |key, value| file.puts "#{key}<=#{value.type}=>#{value.dump}" end diff --git a/data/rbot/plugins/lart.rb b/data/rbot/plugins/lart.rb index 4c945889..aeaad733 100644 --- a/data/rbot/plugins/lart.rb +++ b/data/rbot/plugins/lart.rb @@ -45,8 +45,8 @@ class LartPlugin < Plugin @oldpraise = datafile 'praise' end - @lartfile.replace(datafile "larts-#{lang}") - @praisefile.replace(datafile "praises-#{lang}") + @lartfile.replace(datafile("larts-#{lang}")) + @praisefile.replace(datafile("praises-#{lang}")) @larts.clear @praises.clear if File.exists? @lartfile diff --git a/data/rbot/plugins/quotes.rb b/data/rbot/plugins/quotes.rb index 59234e70..bb5ae57e 100644 --- a/data/rbot/plugins/quotes.rb +++ b/data/rbot/plugins/quotes.rb @@ -16,7 +16,7 @@ class QuotePlugin < Plugin super @lists = Hash.new @changed = Hash.new - Dir[datafile '*'].each {|f| + Dir[datafile('*')].each {|f| next if File.directory?(f) channel = File.basename(f) @lists[channel] = Array.new if(!@lists.has_key?(channel)) @@ -36,7 +36,7 @@ class QuotePlugin < Plugin begin if @changed[channel] debug "Writing new quotefile for channel #{channel} ..." - Utils.safe_save(datafile channel) {|file| + Utils.safe_save(datafile(channel)) {|file| quotes.compact.each {|q| file.puts "#{q.num} | #{q.date} | #{q.source} | #{q.quote}" } diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb index 24c11dd7..6f052fcf 100644 --- a/data/rbot/plugins/urban.rb +++ b/data/rbot/plugins/urban.rb @@ -17,7 +17,7 @@ class UrbanPlugin < Plugin u = URBAN + URI.escape(word) u += '&page=' + p.to_s if p > 1 s = @bot.httputil.get(u) - return m.reply "Couldn't get the urban dictionary definition for #{word}" if s.nil? + return m.reply("Couldn't get the urban dictionary definition for #{word}") if s.nil? notfound = s.match %r{<div style="color: #669FCE"><i>.*?</i> isn't defined} @@ -48,7 +48,7 @@ class UrbanPlugin < Plugin resp = @bot.httputil.head('http://www.urbandictionary.com/random.php', :max_redir => -1, :cache => false) - return m.reply "Couldn't get a random urban dictionary word" if resp.nil? + return m.reply("Couldn't get a random urban dictionary word") if resp.nil? if resp.code == "302" && (loc = resp['location']) words = URI.unescape(loc.match(/define.php\?term=(.*)$/)[1]) rescue nil end |