Extracting and mangling a parameter from a MySQL configuration file Is there a better way of doing this?

File.open( "/etc/my.cnf" ) do |f|
  f.grep( /^testdir/ ) do |line|
    test1 = line.chop.gsub(/ /,"")
    test2 = test1.sub(/.*=/, "")
    RETURN_PATH = "#{test2}/test_ups"
  end
end
Aside from not using a constant for RETURN_PATH (which is obviously wrong and will cause Ruby to warn you), it seems reasonable enough to me.