Ruf's homer, Gausman's arm help Giants beat Padres 3-2 in 10