Introduce bin/git-read command line interface
This commit introduces the bin/git-read executable. So
far, the executable can be passed three flags.
To view the possible options, execute with the --help flag to output
its usage documentation:
usage: git read [--help] [-v|--verbose] [-g|--git-dir <path>] [-o|--output-dir <path>]
Generate HTML from your project's Git history
OPTIONS
--output-dir
specify the directory where the site will be built
--git-dir
specify the parent directory of the project's .git/ directory
The end result of a successful bin/get-read execution
is that middleman build output will be written to
the directory passed as the --output-dir flag.
Test coverage
To ensure that the output of the bin/git-read command
is the same as what’s covered in other System Test cases declared in
test/system, extract the #with_built_output helper.
The #with_built_output leverages the test harness’ test-isolated
temporary directory, and invokes bin/git-read to read from and write
to a build/ directory within the tmpdir. The contents of the build/
directory are served by a constructed through a Rack::Static
middleware Rack::Builder domain specific
language.
To ensure that executions of bin/git-read exit with a
0 status code, this commit introduces the first test case outside of
the test/system directory.
Since that test case doesn’t require all of the System Test case setup,
the test/test_helper.rb file serves as a
re-usable chunk, shared by both styles of test.