Update version for 2.1 RC 2
Fix tests for missing RUBY_ENGINE

Old CRuby versions have no RUBY_ENGINE, but the new tests don't account
for this.  This allows the tests to pass on these old rubies (even
though they don't use default gems).

See #611
Fixing Gem.clear_paths to work in an environment with a Security Constant

Sometimes rubygems will execute in an environment where there is a top level Security constant.
Checking for const_defined? :Security would return true when this Security constant exists, even
if it's not the expected Gem::Security.

defined? does not have this problem, and allows us to check for Gem::Security directly.
Merge pull request #625 from elarkin/master

Fixing Gem.clear_paths to work in an environment with a Security Constan...
Update history for #625
Use metadata['allowed_push_host'] to restrict gem pushing to that host only . Defaults to nil, meaning any host is allowed. Includes tests.

Note that I had to change 2 tests in test_gem_commands_push_command.rb, namely test_execute and test_execute_host; they exploited the fact that gem push previously did not always attempt to load a gem's specification (it only loaded the gemspec if no host was specified). I used existing test helpers to fix those 2 tests.

I figure @rykov of @gemfury will appreciate this. Thanks to @drbrain for implementation suggestions.
Add full_require_paths.

Add convenient method, which returns expanded version of
require_paths. This removes code duplication and may helps #210 a bit.
Don't force the latest minitest through autotest

If minitest is loaded automatically by autotest the latest version is
used.  This leaves you with no ability to use a previous version.

Since RubyGems loads its preferred minitest through Gem::TestCase we can
let the RubyGems test files take care of it.
Initialize all instance variables in #initialize

Some instance variables were lazily initialized later, but I like to
have them all in #initialize so I know what I'm dealing with and to
avoid warnings.
Break line up to fit in 80 columns

I don't like lines that wrap.
Include platform in pretty print output

The index specification in the resolver didn't contain the platform
information.  This made it look like the same gem was used twice when
one of them had a different platform.
Remove TODO that the TODO author hasn't done
Include platform when sorting gems for resolution

When there are multiple possible gems to use for resolution RubyGems
would sort by source (name) and version and choose the latest spec.
This did not include the platform.

Omitting the platform could result in a gem with a C extension being
chosen over the platform-specific version.

Now the various specification classes (in the resolver) include the
platform and the resolver includes platform when sorting.  This causes
the resolver to try using a platform gem before using a gem with a C
extension.

Fixes #635
Merge pull request #622 from arthurnn/fix_push_host

Allow rubygems.org credential creation without --host

Fixes #622
Update history for #622
Use platform to load specs in DependencyResolver

Previously the platform was ignored when fetching specs inside the
dependency resolver.  This meant if gems with different platforms had
the same name and version, a spec with the incorrect platform could be
selected and installed.

Now the platform is included when fetching the spec which forces loading
of the correct specification.

Fixes #635 (again)
Fix metadata version reference

There was no RubyGems 1.9.0, only 2.0.
Fix installation of prerelease gems

When available_specs was introduced it didn't sort the :complete type
(which contains sources from two datasets).

Binary search was added to speed up extracting only the needed tuples
from the result of available_specs (see #595).  Binary search depends on
a sorted list.

The assumption that available_specs returns a sorted list was masked by
the tests which sorted the expected value.  The other available_specs
results are all sorted by default, so this was an easy one to miss on
review.

Fixes #636
Do not sort result of available_specs

Sorting the result may mask errors as found in @d295837 and #636.
Fix warning in GemcutterUtilities tests

Parentheses were missing the test added in #622