get ruby.exe path from Gem.ruby because bundler can change bindir
Fix test failure caused my platform differences

On Windows we receive an extra warning due symlinks, change test
to consider this scenario.

Refs #984
Entirely skip a Specification test on Windows

When skip is used, ensure part of method is still executed.

Ensure (no pun intended) that no chmod is executed.

Refs #984
Normalize error and expectation for test

A path is modified *just* for Windows by the installer, so update
the test accordingly to match expectations.

(Because before, was not even fair) ;-)

Refs #984
Get rid of bogus test failure on Windows

Usage of ~ in PATH is neither expanded or supported by Windows.

Ensure the test is skipped.

Refs #984
Normalize PATH given in test under Windows

In order to check for user's bin directory in PATH, we need to
normalize it so checks match.

Refs #984
Clearer wording for --source option
backport r47201 from ruby/ruby trunk.
Merge pull request #989 from jasonrclark/source_option_clarification

Clearer wording for --source option [ci skip]
backport r47299 from ruby/ruby trunk.
removed useless assignment variables.
Remove meaningless ensure
Merge pull request #1003 from gogotanaka/remove_meaningless_ensure

Remove meaningless ensure from Gem::RDoc
- Fixed confusing message from owner command when adding unknown user. (tenderlove)
Fixes #1004
Lock when adding specs during Gem installation.

When installing Gems in a multi-threaded environment (e.g. Bundler) the
installer would try to run the following code:

    Gem::Specification.add_spec spec unless Gem::Specification.include? spec

This code is not thread-safe for two reasons:

1. Gem::Specification.add_spec modifies a global state
2. Gem::Specification.include? performs a read operation on a global state
   _while_ it might be modified

Working around this can be done in two ways:

1. Add locks to Gem::Specification where needed
2. Add locks in Gem::Installer where needed

The first option would require a lock around most class methods and possibly
other methods. As a result I've decided to, for now, go with option 2. Skimming
through the Installer class this appears to be the only place where a global
state is modified.

I've also removed the extra Gem::Specification.include? check in the installer.
The exact same procedure is also done in Gem::Specification.add_spec itself,
thus this is rather redundant.

The issue that led to this commit is #982 which contains more details about the
problem.
Use install_dir to find git gem checkouts

Previously when a new git source was created from a lockfile the source
would use the default gem install dir even when an alternate was
specified.  This would result in RubyGems being unable to find the
source directory for the gems.
Do not write empty lockfiles upon error

Because Lockfile#to_s occurred inside the opened file in Lockfile#write
if an error was raised the file would be truncated.  Now the content is
created before opening the file which means an exception won't truncate
the file.
Update History for @35c134b, @8a603fc
Test ConnectionPools#no_proxy?

Part of #997
Clean up no_proxy? formatting