Commit 92d57fd
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>1 parent 9061a95 commit 92d57fd
8 files changed
Lines changed: 392 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
64 | 88 | | |
65 | 89 | | |
66 | 90 | | |
| |||
197 | 221 | | |
198 | 222 | | |
199 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
144 | 142 | | |
145 | 143 | | |
146 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
1411 | 1413 | | |
1412 | 1414 | | |
1413 | 1415 | | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1414 | 1446 | | |
1415 | 1447 | | |
1416 | 1448 | | |
| |||
1453 | 1485 | | |
1454 | 1486 | | |
1455 | 1487 | | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1456 | 1496 | | |
1457 | 1497 | | |
1458 | 1498 | | |
| |||
1503 | 1543 | | |
1504 | 1544 | | |
1505 | 1545 | | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1512 | 1549 | | |
1513 | 1550 | | |
1514 | 1551 | | |
| |||
1521 | 1558 | | |
1522 | 1559 | | |
1523 | 1560 | | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1524 | 1565 | | |
1525 | 1566 | | |
1526 | 1567 | | |
| |||
1533 | 1574 | | |
1534 | 1575 | | |
1535 | 1576 | | |
| 1577 | + | |
| 1578 | + | |
1536 | 1579 | | |
1537 | 1580 | | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1538 | 1590 | | |
1539 | | - | |
1540 | | - | |
| 1591 | + | |
| 1592 | + | |
1541 | 1593 | | |
1542 | 1594 | | |
1543 | 1595 | | |
| 1596 | + | |
1544 | 1597 | | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
| 1598 | + | |
| 1599 | + | |
1560 | 1600 | | |
1561 | 1601 | | |
1562 | 1602 | | |
| |||
0 commit comments