octokit/octokit.rb — pull request #266 by nixterrimus (2013-06-15 21:56:49+00:00)
Title: Refactor connection to build once per class

This change refactors how the Faraday connection is created so that it is created once and cached in an instance variable.

The connection module is included in the `Client` class, so the client will build the connection and store it off to an instance variable called connection.

This change also adds tests to ensure that Faraday only builds the connection once. Since the connection is a private method, the tests try to get at the behavior that we want to avoid (building the connection more than once).

I really love octokit, I hope this change makes it a little more awesome. I believe that I've followed the contribution guidelines, but if there is anything I can do to make this pull request even better let me know.