sferik/t — pull request #245 by orangejulius (2014-12-07 18:06:53+00:00)
Title: Print a friendly error when running whoami without authorizing first

New users who run `t whoami` without running `t authorize` first
currently see a nasty error:

spectre256@laguna ~ $ t whoami
/home/spectre256/.gem/ruby/2.1.0/gems/t-2.8.0/lib/t/cli.rb:928:in `whoami': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/spectre256/.gem/ruby/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/spectre256/.gem/ruby/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/spectre256/.gem/ruby/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /home/spectre256/.gem/ruby/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/spectre256/.gem/ruby/2.1.0/gems/t-2.8.0/bin/t:20:in `'
from /home/spectre256/.gem/ruby/2.1.0/bin/t:23:in `load'
from /home/spectre256/.gem/ruby/2.1.0/bin/t:23:in `

'

Now instead they'll see a friendly, helpful message

spectre256@laguna ~/repos/t $ bundle exec t whoami
You haven't authorized an account, run `t authorize` to get started.

I'm happy to make any tweaks if there are preferences for setting up the test, checking for valid configuration, or printing to stderr. Thanks!