Is there a way to connect to the MySQL server using the mysql gem without passing a username/pwd combo and instead loading it from the .my.cnf file?
Easiest way to load them is using inifile
gem.
require 'inifile'
client_options_hash = IniFile.new('~/.my.cnf')['client']
Then you can just use the values from client_options_hash
to set up your connection.