Test each created gem directory

The test for Gem.ensure_gem_directories only tested one of the created
directories.  Now they're all tested.
Add extensions directory to GEM_HOME

The extensions directory will hold built extensions for installed gems
so a gem directory can be shared across ruby versions and platforms.

See #596
Add Gem.ruby_api_version

Extensions must be recompiled for each Ruby API version so we need an
accessor for it.

See #596
Update `gem doctor` for the extensions directory

A full test suite was not run so this change was missed.  Now doctor can
clean up properly.
Add Specification#extension_install_dir

This is the platform and ruby-specific directory where extensions will
be installed when #596 is fixed.  I think I need to detect
statically-linked ruby, too, but I'll leave that for a future commit
because I don't have a statically-linked ruby to test against it yet.
Install extensions into a separate directory

Extensions are now installed into extension_install_dir instead of
gem_dir which will allow multiple ruby versions and platforms to use the
same gem repository.

The Gem::Specification#require_paths and #full_require_paths now include
the extension install directory.
Complete TODO for using Specification#original_name
Fix comment for Gem::Ext::Builder.new
Allow Gem::Ext::Builder to accept only the spec

At install time the build_info file is not yet present so
Gem::Specification#build_args will be empty (this was an oversight that
should be corrected separately, but backwards compatibility must be
maintained).  This meant that the build_args needed to be passed
separately.

After install time the build_args will be present so we can let the
builder fetch them from the specification directly.
Use RFC 2616 compatible time

RFC 2616 states that the time in the If-Modified-Since header must be in GMT.
Time#rfc2822 returns a time with time zone offset whereas Time#httpdate always
returns a time in GMT.
Rename extension build error constant

The constant Gem::Installer::ExtensionBuildError required loading the
installer at extension build time which could be a large amount of
files.  This constant is now an alias of Gem::Ext::BuildError.

The new constant is needed to minimize loading when extensions are built
during activation.

The old constant is deprecated and nodoc'd.
Touch .gem.build_complete upon extension install

If rubygems extensions are to be built at activation time the activation
system needs to know that if the last build was successful (so
activation can proceed) or not.

This file is deleted before building extensions (in case of rebuild) and
written after building all extensions (for success).
Update references to ExtensionBuildError

Gem::Installer::ExtensionBuildError was renamed to Gem::Ext::BuildError
but the other uses were not updated.
Added Specification#gem_build_complete_path

Creation of this path was moved from the various locations in the tests
and in Gem::Ext::Builder into Gem::Specification.
Build missing extensions at gem activation time

During activation, if the current platform does not have extensions
built, RubyGems will attempt to build the extension.
Fix :nodoc: tags

The line before the method was tagged, not the method itself.  I don't
think RDoc will detect this properly.  Also, it doesn't match style.
Fix test names
Include extensions in stub specification data

This will allow require_paths and full_require_paths to be pushed up to
BasicSpecification where they can be shared between the two
specification types.

This requires a second stub line as the final value in the stub
specification is the require paths which may include spaces.  This means
the extensions must go on another line as the spaces are not escaped nor
can we change the format of the stub line.
Move require_paths up to BasicSpecification

In order to determine if a gem contains a particular requirable file
the BasicSpecification also needs to look in the extension install
directory.

This means the two methods (require_paths and extension_install_dir) to
support this need to move up to Gem::BasicSpecification from
Gem::Specification.

This commit brings up a question:  Does building the extensions need to
happen sooner than activate?  In contains_requirable_file? instead?
Use full_require_paths in contains_requirable_file?

This also moves full_require_paths from Gem::Specification to
Gem::BasicSpecification.

Gem::StubSpecification#find_full_gem_path was added which only returns
the nomalized platform path (unlike Specification#find_full_gem_path
which also looks for the original_name-based path for compatibility).