ruby-build/test
Jean Boussier 92d57fdbb6
Support building with version prefix (#2610)
* 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>
2026-05-01 12:25:11 +02:00
..
fixtures Fix linking to older OpenSSL for Ruby < 2.7.7 2023-12-07 15:52:10 +01:00
stubs Improve test output for failed stubs 2025-01-15 15:24:07 +01:00
tmp Ensure test/tmp directory exists 2012-11-19 19:25:52 -06:00
arguments.bats Improve cached_tarball test helper 2023-10-17 12:40:17 +02:00
build.bats Support building with version prefix (#2610) 2026-05-01 12:25:11 +02:00
cache.bats Drop the default package mirror 2025-09-12 09:49:34 -07:00
checksum.bats Show progress of downloaded files in the terminal 2023-11-07 10:17:54 +01:00
compiler.bats Fix compiling Ruby < 2.5 by omitting --with-ext 2023-11-24 22:08:28 +01:00
definitions.bats Support building with version prefix (#2610) 2026-05-01 12:25:11 +02:00
fetch.bats Support building from arbitrary git revision 2026-02-19 08:42:16 +01:00
hooks.bats Suggest rbenv global if there is no explicit global setting (#2052) 2022-09-25 11:20:43 +02:00
installer.bats Add ruby-build(1) man page 2023-11-07 18:20:59 +01:00
mirror.bats Drop the default package mirror 2025-09-12 09:49:34 -07:00
output.bats Fix commands printed when TMPDIR is empty 2023-11-08 23:56:03 +01:00
rbenv.bats Support building with version prefix (#2610) 2026-05-01 12:25:11 +02:00
test_helper.bash Fix test 2025-04-18 15:09:22 +08:00
version.bats update urls to rbenv 2015-12-07 14:17:04 -08:00