if MAKE or make are in the environment, use those instead of rbconfig's
make. necessary for those who built ruby with something other than
GNU make (gmake is required to build mkmf output)
Add a Gem::StubSpecification object to parse specification stublines
Write stubline out to gemspecs
Avoid loading all gemspecs

Parse out "stublines", where available, to retrieve the information
necessary to determine whether to activate a particular gemspec.

This requires sharing some code between Gem::Specification and
Gem::StubSpecification, so I created an abstract BasicSpecification
class to achieve this.
DRY up Specification._all/.stubs

Populate _all from stubs.
Memoize StubSpecification values

Prevents us parsing the stub line / building the objects on each call.
Encrypt Private Key before writing to disk.
Ask for passphrase when creating the key for a certificate.
Load encrypted private key using ENV['GEM_PRIVATE_KEY_PASSPHRASE'] as passphrase.
Sign built packages with encrypted key.
Use File.join instead of manual path creation.

This prevents issues, when File.join in #new_default_spec removes
superfluous slashes while they are kept in expected paths. E.g. the test
would fail if ruby configuration specifies --with-ruby-version=''.
Do not add last slash to Gem.user_dir if ruby_version string is empty.
Change private key cipher to AES 256 by default. Re-order arguments to
Gem::Security.write so cipher is last.
Write the private key to disk only when creating it.
Remove check for gem subdirectories.

This check is done later in Installer#pre_install_checks anyway.
Fixed placement of executables with --user-install

Previously executables for --user-install were placed in ~/.gem.  It
seems this broke at some time during the 1.8.x series due to a missing
test.

This caused an attempt to install executables into the default bin
directory which is usually only writable by a super-user.

This was fixed by setting the bin directory to the appropriate path if
the :user_install option was enabled.
Fix gsub for tests on windows

The gsub! inadvertently altered @bin_dir while checking if the user bin
dir was in the user's path.

Now gsub is used instead to isolate the check from the instance variable
it is checking.

Fixes ruby bug #7885
Fixed `gem update --user-install`

In the update command the installer was created before parsing any
options.

This prevented the installer from using any options such as
--user-install if they were given on the command line.

Now the installer is created after option processing in #execute.

Fixes ruby bug #7779
Create extension destination directory

After an extconf.rb extension is built it is installed into the "lib"
directory.  If the "lib" directory was not present in the package this
would cause the shared object to be named "lib" instead of its proper
name.

This patch creates the destination directory before building the
extension to ensure the shared object will be installed with the correct
name.

Ruby Bug #7897, patch by Kenta Murata
Set release version