Provide more info on file path length errors

These messages will allow developers to easily find the file which name was too long to be packaged.
Initialize StubSpecification’s @name to make RubyGems warning-free
Fix bug of Gem::Text#min3

- remove an unnecessary comparison.
Add trailing `then`.
Add test `Gem::Text#min3`.
Remove shared libraries before copying them into place

Fixes issue #1037

When building an extension that's still loaded into memory, cp_r replaces the
file contents of the same inode. Since Linux mmaps shared libs, they will get
reloaded but not relocated, leading to corruption of the GOT/PLT.

The fix is to unlink the destination before copying, which creates a new inode
and prevents the file from being reloaded.
Drop `rescue TSort::Cyclic` from `Gem::{DependencyList,RequestSet}#tsort_each_child`.

`TSort::Cyclic` is only raised from `TSort.tsort_each`, not from `TSort#strongly_connected_components` which is used here. Even then, the exception is raised outside the child iterator and thus cannot be rescued in `#tsort_each_child`.

Originally introduced in f554bc5 and a1d35cd, respectively.
Don't touch the binary when not needed.

This might cause issues, when Bundler uses the git repository, but the
repository is read-only. In such case, although everything is in correct
state, the execution fails with 'Errno::EPERM: Operation not permitted @
chmod_internal' error.
Cache Gem::StubSpecification#activated?.

this reduces about 10% total time of Kernel.require on my test environment.
Cache Gem::BasicSpecification#contains_requirable_file?.

this reduces about 10% total time of Kernel.require on my test environment.
Pass the full path when calling the original Kernel.require if available.

calling the original Kernel.require with a full path is about 25% faster than with path-less paramter.
this reduces about 5% total time of rubygem's Kernel.require on my test environment.
shouldn't be able to get the fullpath before activating.
Test if TooLongFileName exception messages include names of the offending files.
Skip pristine install for non-cached gem unknown at remote source

This prevents failure on trying to do a pristine installation for a
private gem that is not cached.
Fetch gem to proper cache dir when gem path is not gem home

This fixes the pristine installation error for a gem that is installed
to other GEM PATH than $GEM_HOME and the cache file for that gem is
missing.

Example scenario:

```
$ cat ~/.gemrc
---
:sources:
- https://rubygems.org/
gem: --no-ri --no-rdoc
gempath:
- /Users/tkareine/gem-repo

$ gem env
RubyGems Environment:
  ...
  - INSTALLATION DIRECTORY: /Users/tkareine/.gem/ruby/1.9.3
  ...
  - GEM PATHS:
     - /Users/tkareine/.gem/ruby/1.9.3
     - /Users/tkareine/gem-repo
  ...

$ gem install -i ~/gem-repo timecop
Fetching: timecop-0.7.1.gem (100%)
Successfully installed timecop-0.7.1
1 gem installed

$ rm gem-repo/cache/timecop-0.7.1.gem
```

Without the fix we get an error:

```
$ gem pristine timecop
Restoring gems to pristine condition...
Cached gem for timecop-0.7.1 not found, attempting to fetch...
Fetching: timecop-0.7.1.gem (100%)
ERROR:  While executing gem ... (Gem::InstallError)
    invalid gem: No such file or directory - /Users/tkareine/gem-repo/cache/timecop-0.7.1.gem
```

With the fix:

```
$ gem pristine timecop
Restoring gems to pristine condition...
Cached gem for timecop-0.7.1 not found, attempting to fetch...
Fetching: timecop-0.7.1.gem (100%)
Restored timecop-0.7.1
```
Replace `partition` with `reject` as selected elements are not used
Skip pristine install for gems bundled with old Ruby

MRI Rubies older than 2.0.0 do not store bundled gem specification files
under `default` subdirectory, failing to be recognized as default gems
and thus be skipped from pristine installs by Rubygems.

We observe that old Ruby stores these gems with a regular pattern in
spec's summary field:

```
$ cat ~/.rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/specifications/bigdecimal-1.1.0.gemspec
Gem::Specification.new do |s|
  s.name = "bigdecimal"
  s.version = "1.1.0"
  s.summary = "This bigdecimal is bundled with Ruby"
  s.executables = []
end
```

We use this to detect bundled gems when using old Ruby. This allows us
to run pristine install on all gems without errors:

```
$ gem pristine --all
Restoring gems to pristine condition...
Skipped bigdecimal-1.1.0, it is bundled with Ruby < 2.0.0
Skipped io-console-0.3, it is bundled with Ruby < 2.0.0
Skipped json-1.5.5, it is bundled with Ruby < 2.0.0
...
```

It's unclear to me if this detection should be combined to
`Gem::BasicSpecification#default_gem?` and made available to other
commands (such as `gem clean`).
Describe issues and milestones
Match loaded spec for Kernel#gem and Gem.bin_path

Previously we looked for newer versions when running Kernel#gem and
Gem.bin_path which would lead to executable stubs attempting to use the
latest version when RUBYGEMS_GEMDEPS was active or another version had
been loaded.

Now we first check the loaded (active) specifications against the
requirement and check that version against the given dependency.

Fixes #1072
Handle pinned lockfile dependencies with versions

A lockfile dependency entry can contain both a version and a ! for
pinning.  This case had not been encountered previously but is now.

Fixes #1054