Fix code example for custom hook

Change-Id: I6f5b97266db55b5cda9a78390949290dcb2a93f2
Reviewed-on: http://gerrit.causes.com/42168
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Warn when attempting to pipe commands

The `execute` helper does not support piping commands due to the
complexity of supporting this in both MRI and JRuby implementations.

In order to prevent misuse, fail loudly to the user if they try to use
the pipe character as one of the arguments in their command.

Change-Id: Id87e3173a6cb4936c2f06733c688201c1a31dada
Reviewed-on: http://gerrit.causes.com/42170
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Include standard out/error output in exception output

The pre-commit hook context would only include output from standard
error when an exception occurred. Unfortunately, this sometimes leaves
out important information for debugging purposes.

Include both streams in the output to aid in debugging.

Change-Id: Ib38348174c983d7133721120c64af6cba8f0254e
Reviewed-on: http://gerrit.causes.com/42177
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Cut version 0.17.0

Some people refer to releasing a new version of a gem as "cutting"
a new version. This commit marks the release of overcommit 0.17.0,
and follows the pattern of commits from previous releases.

Change-Id: I9557ea85f409169d79c6e617cbf016b1ecb95a23
Reviewed-on: http://gerrit.causes.com/42091
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Joe Lencioni <joe.lencioni@brigade.com>
Upgrade Rubocop to 0.25.0 for Travis builds

Change-Id: I556b5ad4c9d92f2d1c21f04648930a01b353a942
Reviewed-on: http://gerrit.causes.com/42207
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Update image_optim from 0.14.0 -> 0.15.0

The latest version of the `image_optim` gem broke Overcommit's
`ImageOptim` pre-commit hook due to a change in the name of the
`BinNotFoundError` exception. Fix it and change the version constraint
in the gemspec.

Change-Id: Ie938de988887b2794115c35c45d654c7f7d9d678
Reviewed-on: http://gerrit.causes.com/42208
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Upgrade Rubocop for Travis builds from 0.25.0 -> 0.26.0

In the process, we've also decided to switch access modifiers from
outdented style to indented, keeping us in line with the defaults.

Change-Id: Id578bffad07009a8b5c9e1fe9c9a3858f8e57ccd
Reviewed-on: http://gerrit.causes.com/42250
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
Add CLI option to list available hooks

This commit adds a command line option (-l/--list-hooks) to list all the
hooks available for a given repo. All hooks will be printed sorted by
the context in which they run, along with whether the hook is currently
enabled or disabled.

In order to do this I made `Overcommit::Configuration#hook_enabled?`
public. There is logic there to determine whether a certain hook is
enabled or disabled for a given context, and rather than duplicate this
logic elsewhere, it made more sense to make the method available to
`Overcommit::CLI` when printing the hooks.

Change-Id: Ief2bddf04957fb208c50f2faec4b705879825d89