Fix wrong version of gem activation for bin stub.
Gem FOO version 1 is installed with a bin file. The bin file requires "FOO.rb" Gem FOO version 2 is installed, no longer has the bin file, but still contains "FOO.rb" If the user has FOO gem version 1 and 2 installed, the bin file for version 1 will erroneously require "FOO.rb" from version 2. This commit changes the bin file to find the executable and activate the gem spec that contains that executable. To do this, I introduced a new function called `activate_bin_path` which should only be used in bin stubs. This function is exactly the same as `bin_path`, but as a side effect activates the gemspec that contains the binfile. `bin_path` is public and documented, so I didn't want to change it to activate gem specifications.
- Loading branch information