diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-01-12 22:15:12 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-01-12 22:15:12 +0100 |
commit | 12a508e1a75bc1de501f36ca9e4767f2349fe12e (patch) | |
tree | 8ec4db236d70c064742b87c79feb86e783312e1c /data/rbot/plugins/games/uno.rb | |
parent | cafa66beb3392f30ba8f11e6763f690518512471 (diff) |
Ruby 1.9 cleanup: variables warnings
Fix most ruby 1.9 warnings about shadowed variables (still one remaining in
keywords.rb). The only significant changes are in the quiz game plugin.
Also fix an issue in dictclient where the block parameter of a method
was not correctly isolated from the previous parameter.
Diffstat (limited to 'data/rbot/plugins/games/uno.rb')
-rw-r--r-- | data/rbot/plugins/games/uno.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index 75154362..ab0ea161 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -772,9 +772,9 @@ class UnoGame } return false end - if p = get_player(user) + if pl = get_player(user) announce _("%{p} is already playing %{uno} here") % { - :p => p, :uno => UNO + :p => pl, :uno => UNO } return false end @@ -831,12 +831,12 @@ class UnoGame deal(p, @picker) @picker = 0 end - score = @players.inject(0) do |sum, p| - if p.cards.length > 0 + score = @players.inject(0) do |sum, pl| + if pl.cards.length > 0 announce _("%{p} still had %{cards}") % { - :p => p, :cards => p.cards.join(' ') + :p => pl, :cards => pl.cards.join(' ') } - sum += p.cards.inject(0) do |cs, c| + sum += pl.cards.inject(0) do |cs, c| cs += c.score end end |