desktoppr/wbench — pull request #8 by codeblooded (2013-03-02 03:45:56+00:00)
Title: Add Gist Support

### Overview
I noticed that you marked adding Gist Support to the TODO list, and I thought that I might spare you the trouble. This pull request allows the user to save the results as a Gist on GitHub (binded either to their account or anonymously). In order for a user to bind the Gist to their account they must `export GITHUB_USER=username` and `export GITHUB_TOKEN=token`. To create the gist simply use `-g [NAME]` and you can make it a secret gist using `-s`.

### How it Works
The actual request is made using the rest-client gem. While the request can be made over net/https, it requires a lot more code and a certificate to validate for security. Rest-client cleaned up the code quite a bit, so I added it as a dependency. In order to prevent a lot of ASCII color codes appearing in the Gist, I added a global variable `$NO_COLOR` and a method in the formatting classes `print_with_color(str, color)` to make sure that the Gist did not attempt to process the colors. The terminal output remains the same.

### Two Specs
I added two new specs. One checks that the JSON used for the request to the GitHub API is in the correct format. The second attempts to create a gist on GitHub anonymously (it passes after this commit, but you might want to comment it out so that it does not keep creating gists when testing).

I think that this is a start to Gist support for WBench. Thanks for you time and consideration.