sub(/\.erb$/,'') would be better