From: Eric Hodel Date: 2010-12-15T13:35:11+09:00 Subject: [ruby-core:33721] Suppressing "assigned but unused variable" I have stopped assigning many unused variables thanks to this new warning. I have a spot where the warning is false, though: $ cat test.rb def b a = :some_value binding end eval 'puts a', b $ ruby19 -vw test.rb ruby 1.9.3dev (2010-12-15 trunk 30218) [x86_64-darwin10.5.0] test.rb:2: warning: assigned but unused variable - a some_value In this case, a is captured by the binding for later use, but ruby warns anyway. I can work around this warning by double-assigning a: def b a = a = :some_value binding end But that looks ugly. Is there a better way?