Until now, GEMS added via `gem.add_dependency` retained the last `MRuby::Build.current` from the build configuration file, which was accessible from the top level of `mrbgem.rake`.
The mrbgem guide (`doc/guides/mrbgems.md`) documents the `path:`
argument for `conf.gem` as being used to point to the root directory
of a gem when that gem is retrieved via git but is located in a
subdirectory of the checkout.
The actual code does not do this. Instead, it treats path as (mostly)
identical to the `gemdir:` argument; that is, it points to a local
directory containing the gem.
This change fixes this by making `path:` behave as documented.
- Converted LoadGems::load_special_path_gems() into a class, then
subdivided the various types of gem dependencies into smaller
private methods.
- Added class GemDepDetails to hold the relationship between a gem's
location on the local disk and its upstream repository. This will
be used later.
- Removed the last remains of the '--pull-gems' option from the code
base and documentation. This is no longer present and the dead code
is clutter.
Gracefully handle the case where multiple gems use the same git checkout path.
Previously, if two gems had the same directory name when cloning them
from git, mrbgems would assume they were the same gem. This also
applied to different branches and/or commits of the same repository.
This led to a strange situation where the first `conf.gem` statement
"won" in cloning the repository but the last `conf.gem` ended up
choosing the branch/commit-id to use.
This change detects this situation and makes it an error. It also
allows the config writer to explicitly specify a gem checkout to use
in place of the others.
It was relative from the directory of the build configuration file, but
the document says it's relative from `MRUBY_ROOT`. When the default
configuration file was `MRUBY_ROOT/build_config.rb`, it was OK for most
of the cases.
- Defer YAML library and lock file loading until needed.
- Don't write empty parts into lock file.
- Extract code to read/write lock file to `MRuby::Lockfile`.
- `MRuby::Lockfile.disable` disables the use of lock file.