Travis::CommitCommand: refactor rspec to be DRY

This patch does not affect implementation (class behavior).

It uses rspec shared examples so an author can easily
add new commit commands and reuse existing unit tests.
Travis::CommitCommand: refactor implementation to be DRY

Support all forward and backwards forms of command keywords
with a DRYer implementation.

Behavior change: After this commit, recognize the special
"colon" form both forwards and backwards.
IOW both [ci:keyword] and [keyword:ci].

Document the class yardoc-style.
WIP: enable to set debug mode for single build

Add keyword 'debug' to Travis::CommitCommand.
For example, include this in the commit message...

    # Escape the ci to avoid interpretation.
    [\c\i debug]

...to export TRAVIS_DEBUG=true to build environment.

I'm not sure at this point how to delegate the key-value pairs
to the builder. I'm pretty sure it needs to be delegated to
`travis_vars` at
https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/data/env.rb

/me needs to understand code better or get help.

Use case: Be able to override default settings for a single build.
Example:

    case ENV['TRAVIS_DEBUG'] == 'true'
    when true
      # Set numerous debug options that your tests use.
      fail_fast = false
      suppress_warnings = false
    else
      # Default to 'quiet' mode.
      fail_fast = true
      suppress_warnings = true
    end
Add rspec shared context that is useful for testing env vars

Occasionally it is necessary to modify or add an environment
variable in unit tests.

This patchset does not alter existing behavior of travis-core
or its unit tests. This patchset provides:

* A shared context that can be optionally included in an example group
* Unit tests to validate the behavior of the shared context
* Sample usage as comments within travis/testing/environment_context.rb

I forklifted this code from my own library repo at
https://github.com/jumanjiman/jumanjiman_spec_helper
to avoid adding a dependency to travis-core.

New unit tests:

    Travis::EnvironmentContext
      is accessible as Travis::EnvironmentContext
      when included
        preserves pre-existing env var
        restores pre-existing env var if changed within example
        discards env var if created within example
      when not included (i.e., default rspec behavior)
        preserves pre-existing env var
        clobbers env var if changed within example
        persists env var if created within example

I am the original author of this code and have the rights to
contribute it under the MIT license used by travis-core
even though my library uses an Apache license.

Signed-off-by: Paul Morgan <jumanjiman@gmail.com>
WIP: enable to set granular vars for single build

Use case 1: Be able to set things like seeds for the test run
as mentioned at https://github.com/travis-ci/travis-core/issues/161

Use case 2: Be able to override default build configuration for
a single build. Example...

    RSpec.configure do |c|
      # Fail fast to reduce duration of test runs.
      # IOW get out of the way so that the next pull request gets tested.
      # Override for a single build using a Travis commit command.
      c.fail_fast = ENV['fail_fast'] == 'true' ? true : false
    end

Extend Travis::CommitCommand with the concept of assignments.
For example, include this in the commit message...

    # Escape the ci to avoid interpretation.
    [\c\i fail_fast = true]

...to get interpreted as `[{ 'fail_fast' => 'true' }]` and
exported to the build environment as `fail_fast=true`.

I'm not sure at this point how to delegate the key-value pairs
to the builder. /me needs to understand code better or get help.