sharethrough/flare-up — pull request #13 by ilyakava (2014-11-13 16:12:53+00:00)
Title: Ensure rescue on ArgumentError doesn't itself raise an exception and crash

Hey there, thanks for the great gem!

On my first run, I saw:

```
/Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/emitter.rb:38:in `block in sanitize': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/emitter.rb:37:in `each'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/emitter.rb:37:in `sanitize'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/emitter.rb:16:in `error'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/cli.rb:36:in `rescue in copy'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/flare-up-0.7/lib/flare_up/cli.rb:30:in `copy'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/artsyinc/.rvm/gems/ruby-2.1.0@flare/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from ./bin/flare-up:5:in `

'
```

This is because `@BOOT_OPTIONS` is `nil` [here](https://github.com/sharethrough/flare-up/blob/c6be8b8f88305afb0eb69ff26fca8b23306f6c04/lib/flare_up/emitter.rb#L35), as a result of `Emitter.store_options` running too late [here](https://github.com/sharethrough/flare-up/blob/c6be8b8f88305afb0eb69ff26fca8b23306f6c04/lib/flare_up/cli.rb#L40) after the `begin`/`resuce` block.

This PR moves that line earlier, to get a nice and friendly `One of either the --redshift_username option or the ENV['REDSHIFT_USERNAME'] must be set` instead