Upon installing their first Ruby version on the system, the user may want to set it as their default; otherwise the default will remain "system" and any `gem install` attempts will fail with a permission error.
This suggestion is skipped if the user already has chosen an explicit default, even if it's "system".
MRI's BigInt use GMP under the hood if available, and if not
fallbacks to an homemade implementation with much worse performance.
Without GMP:
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 13.80743500002427
```
With GMP
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 0.4098639999865554
```
macOS not being a common production platform, it's not a huge deal
but it would still preferable to compile with `gmp.h` if present.
I'd also suggest to print a warning if compiling on macOS and gmp
isn't installed, but I don't know if it's desirable.
NB: `--with-gmp-dir` was only added recently, so this will only
apply to MRI >= 3.2, as well as rubies on which this flag was backported.
Prior commit attempts to shorten install by omitting documentation install,
however an additional target is needed to get the conf dirs for capturing the
PEMs et al.
The check to prevent deleting user files during clean_prefix_path by disallowing
installs into existing directories that weren't earlier truffleruby installs broke
asdf installs, as asdf always creates an empty directory before installing.
This fix adds a second exception to the existing directory case when that directory
is empty. The check is done via testing the length of ls output. The logic was
manually tested against non-existing directories, existing empty directories,
existing non-empty directories in general, and existing non-empty directories
that contained a file named "bin/truffleruby".
I also copied the file over my existing asdf version of ruby-build and made sure that
it successfully installed truffleruby.