Check tasks with Rubocop and fix offenses.

Also update Ruby version for Travis.