You can assign multiple variables to multiple values on one line in Ruby.
That line is equivalent to the following:
old_warn = $-w
$-w = false
If you were asking what the purpose was; $-w
is a global variable in Ruby that points to a boolean that indicates whether or not the user passed the -w
flag to the ruby
executable when they ran the script. In other words, the variable indicates whether or not the script/program is currently supposed to be printing "warnings".
Essentially, the purpose of that entire block of code is to ensure that warnings are turned off before executing it's core. The old value of the warn flag is saved into a new variable; the warn flag is turned off; and then when the execution is done, the warn flag is re-set back to whatever it used to be.