get ruby.exe path from Gem.ruby because bundler can change bindir
Clearer wording for --source option
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
Match no_proxy wildcards correctly.

A wildcard no_proxy entry (with a leading dot) must match a domain
without the leading dot, but RubyGems did not support this.  Now
RubyGems strips the dot to check for a match.

Fixes #997
Refactor early-exit to use Enumerable#any?
Add #1004 to History
Add #1003 to History
Add #989 to History
Fix unused variable warning