balanced/balanced-ruby — pull request #185 by ged (2014-06-23 23:31:25+00:00)
Title: Remove balanced-specific subdirectories from the global $LOAD_PATH

Libraries intended for use by third parties should never add their subdirectories to the global $LOAD_PATH. Adding the `lib/balanced/resources` subdirectory means that anyone that has their own code with the same name as any of the files in `lib/balanced/resources` won't be able to `require` their code after a `require 'balanced'`.

For example, if your own code has a file named `lib/bank_account.rb`, you won't be able to `require` it after 'balanced'. Require will already have loaded `balanced/resources/bank_account.rb`, and cached it for the `bank_account` path, so it will just return `false` and do nothing.

The solution to this is to avoid modifying the `$LOAD_PATH` yourself from library code, and instead
either make your requires qualified against your library's base libdir in the global `$LOAD_PATH`, or (if you only support Ruby 1.9 or later) use `require_relative` instead.

This PR does the former. The test is a bit simplistic, as it really should be testing the positive case, but since in this case the positive case is `require` loading your own code after requiring 'balanced', the simplistic course seemed the better one.