* Support building with version prefix
Commonly in CI pipelines and other scripts, users may
want to install the latest from a specific series, e.g.
`3.4` or `jruby-10.0`.
```bash
$ bin/ruby-build 3.4 /tmp/3.4
...
Downloading ruby-3.4.9.tar.gz...
$ bin/ruby-build 4.0 /tmp/4.0
...
Downloading ruby-4.0.2.tar.gz...
```
Also support `--resolve`:
```bash
$ bin/ruby-build --resolve 3.4
3.4.9
```
* Improve version name resolution from prefix
- `ruby-build --resolve` now prints canonical definition names, always
stripping the "ruby-" prefix from output (e.g. "ruby-3.4" => "3.4.9").
- Fix sorting versions so that "jruby" correctly resolves to "jruby-10.x"
instead of to "jruby-9.x".
- Support bare "ruby" argument to select the latest CRuby version, since
that was already possible for "jruby", "mruby", et al.
- Case-normalize version inputs so that arguments like "JRuby" or
"TruffleRuby" resolve to their lowercase definitions.
- Simplify definition file lookup: all code paths now go through
resolve_version.
- Restore the named-pipe + `--dir` check to correctly abort early.
- Update README and man page: bump Ruby version numbers in examples, add
Ruby implementations section, document the `--resolve` option.
* Clarify what ruby-build considers to be "latest" Ruby version
* Print usage error message if `--resolve` wasn't passed an argument
---------
Co-authored-by: Mislav Marohnić <git@mislav.net>
While bisecting, or building a nightly Ruby CI and some other situations,
it is useful to be able to build a specific Ruby revision rather than
just the tip of Ruby's master branch.
37signals are dropping AWS, which means goodbye to S3 and CloudFront.
The CloudFront mirror (dqw8nmjcqpjn7.cloudfront.net) was introduced ages
ago to address intermittent unavailability from some upstream sources.
These days, it mainly serves non-MRI packages like OpenSSL and libyaml.
Ruby releases are now served by Fastly (cache.ruby-lang.org) which has
bypassed the ruby-build mirror since 2015. Other sources (GitHub, RubyGems,
Maven) have their own CDNs.
This change removes the default `RUBY_BUILD_MIRROR_URL` and S3 release
mirroring. Custom mirror support remains.
Add examples of passing a custom build definition file in place of a
'known' ruby version. This is meant to more clearly document how users
might use a custom build definition for a recently-released ruby that is
not yet bundled in ruby-build.
Additionally, document in the readme how to use `RUBY_BUILD_DEFINITIONS`
path environment variable to provide a _collection_ of custom build
definitions. This is meant to give guidance on how an organization might
share multiple custom build definitions, or downstream users of
ruby-build (like asdf-ruby) might publish unreleased rubies for
installation.
- quibbling over wording: custom build defs _are_ recognized by
ruby-build, just not bundled or available out of the box.
Otherwise `gem install` and `bundle install` (without `--path`) won't work without `sudo`.
In fact the previous example install command wouldn't work at all without `sudo`.
* By searching a X.Y.Z definition if no ruby-X.Y.Z definition is not found.
* Add test and documentation.
Co-authored-by: Mislav Marohnić <git@mislav.net>
* Clarify RUBY_BUILD_ROOT env var
The RUBY_BUILD_ROOT itself does not default to share/ruby-build/ but rather must point to a directory that has definitions under `share/ruby-build/`.
* Deprecate RUBY_BUILD_ROOT
It's a feature of questionable utility, it's difficult to describe in documentation, and has been superseded by RUBY_BUILD_DEFINITIONS.
---------
Co-authored-by: Mislav Marohnić <git@mislav.net>