Add automatic Ruby download support using rv binaries#1668
Conversation
Current Ruby support can only use Ruby interpreters which are already installed on the system, although it goes to great lengths to find interpreters installed by a variety of Ruby managers. This change adds support for installing new interpreters using the binaries delivered by the `rv` team. `rv` only provide installers for versions of Ruby still actively supported (so they don't offer version 3.1, for example), and only build for a subset of all Ruby-supported platforms. If users need an unsupported version of Ruby or wish to use an unsupported platform, they will be prompted to download and install a version of Ruby manually. `rv` bundles are named according to the platform, currently including these components in the filename: - x86_64_linux - arm64_linux - x86_64_linux_musl - arm64_linux_musl - ventura (used for macOS on x86_64) - arm64_sonoma (used for macOS on 64-bit ARM) If and when upstream `rv` changes these names, the detection code will need to be updated to match. In particular, this includes the use of macOS codenames, as if `rv` stop releasing a 'sonoma' package, this will block installing the macOS versions of Ruby. Currently `rv` seem to be attempting to keep these codenames, as they already rename their x86_64 builds from 'sequoia' (macOS 15) to 'ventura' (macOS 13). Adding a new CPU architecture (such as RISC-V) would also need changes, but wouldn't break existing platform support. Ruby versions are found by querying the GitHub Releases API, searching the options returned for an installer that matches the platform and version requirements, then, if found, downloading and unpacking into the `prek` tools folder. The `PREK_RUBY_MIRROR` environment variable can be used to point to a different source for installers, for example to support mirrors or air-gapped CI environments. Mirrors need to follow the GitHub URL patterns, but note that although the GitHub hostname changes between `api.github.com` and `github.com` as needed, any non-GitHub mirror server will not be remapped in this manner. Where Ruby is being downloaded from GitHub (either from the upstream `rv` or a mirror), this remapping does occur, and any `GITHUB_TOKEN` will be sent with the requests. This both limits impact of rate limiting, and also allows a private GitHub repository to be used (e.g. for a vetted subset of `rv` rubies to be mirrored). Note that GitHub tokens will only be sent to mirrors which are hosted on GitHub. To allow for passing the `GITHUB_TOKEN` in download requests, the generic `download_and_extract` function is now a wrapper over a version which takes an extension function, with the default function not extending the request. The Ruby code will add the GitHub token if the request is to GitHub.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1668 +/- ##
==========================================
- Coverage 91.58% 91.29% -0.29%
==========================================
Files 97 97
Lines 19004 19241 +237
==========================================
+ Hits 17404 17566 +162
- Misses 1600 1675 +75 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.42% (23.8 MiB → 23.9 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
|
We need to update the Ruby support status on this page: Lines 313 to 317 in 85d6dc6 |
Good point! I'm trying to deal with the CI failures, I'll add that as well. It looks like the Mac issues may be simply that the GitHub API is being rate limited from the CI runner (but I'll have to work out a way around that...) |
Looking for available Ruby versions via the API is subject to rate limiting when a GitHub token is not supplied. This change improves the messaging when GitHub return an error which may suggest that rate limiting is being applied, hinting to the user that they may need to supply a GitHub token.
To avoid being rate-limited when running tests, pass the GitHub token in
to the language tests (used by Ruby to download interpreters). The token
has no special permissions (the workflow already includes `permissions:
{}` at the top level), but this is sufficient to raise the rate limit.
There was a problem hiding this comment.
Pull request overview
This pull request adds automatic Ruby interpreter download support to prek using binaries from the rv-ruby project. Previously, prek could only use Ruby interpreters already installed on the system. With this change, prek can automatically download and install Ruby versions when requested versions aren't available locally.
Changes:
- Implements automatic Ruby download from rv-ruby GitHub releases for supported platforms (macOS and Linux on x86_64 and ARM64)
- Adds
PREK_RUBY_MIRRORenvironment variable for mirror/air-gapped support with GitHub token authentication - Extends download infrastructure with
download_and_extract_withto support request customization for authentication headers
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/languages.md | Updates Ruby documentation to reflect automatic download support and mirror configuration |
| crates/prek/tests/languages/ruby.rs | Adds comprehensive integration test for auto-download and caching behavior; updates error message snapshots |
| crates/prek/src/languages/ruby/version.rs | Adds Display trait implementation for RubyRequest to improve error messages |
| crates/prek/src/languages/ruby/ruby.rs | Integrates installer with download support by passing allows_download flag and tools directory path |
| crates/prek/src/languages/ruby/installer.rs | Core implementation: GitHub release API querying, platform detection, download logic, system Ruby search (including rv paths), and extensive test coverage |
| crates/prek/src/languages/mod.rs | Adds download_and_extract_with wrapper to support request customization (e.g., auth headers) |
| crates/prek-consts/src/env_vars.rs | Adds PREK_RUBY_MIRROR environment variable constant |
| .github/workflows/ci.yml | Propagates GITHUB_TOKEN to language tests to avoid API rate limiting |
# Conflicts: # docs/configuration.md
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [prek](https://github.com/j178/prek) | patch | `0.3.1` → `0.3.13` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>j178/prek (prek)</summary> ### [`v0.3.13`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#0313) [Compare Source](j178/prek@v0.3.12...v0.3.13) Released on 2026-05-06. ##### Bug fixes - Respect hook filters for message files ([#​2049](j178/prek#2049)) ##### Documentation - Add Godot Engine to users in README ([#​2047](j178/prek#2047)) ##### Contributors - [@​j178](https://github.com/j178) - [@​Calinou](https://github.com/Calinou) ### [`v0.3.12`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#0312) [Compare Source](j178/prek@v0.3.11...v0.3.12) Released on 2026-05-05. ##### Highlights `auto_update.cooldown_days` is now available in both the user-level global config (`~/.config/prek/prek.toml` on Linux and macOS, or `$XDG_CONFIG_HOME/prek/prek.toml` when set; `%APPDATA%\prek\prek.toml` on Windows) and project config. Set a user default for `prek auto-update`, then override it per project when a repository needs a different update cadence. ```toml [auto_update] cooldown_days = 7 ``` ##### Enhancements - Add global auto-update cooldown config ([#​2041](j178/prek#2041)) - Add project auto-update cooldown config ([#​2044](j178/prek#2044)) - Support `language: dart` ([#​1146](j178/prek#1146)) ##### Bug fixes - Pass commit message file to workspace hooks ([#​2043](j178/prek#2043)) - Preserve non-UTF8 filenames from git ([#​2023](j178/prek#2023)) - ruby: put resolved Ruby's bin dir on `$PATH` for `gem` invocations ([#​2021](j178/prek#2021)) ##### Documentation - Update docs with the new logo and icon ([#​2025](j178/prek#2025)) - Point schema docs to SchemaStore ([#​2039](j178/prek#2039)) ##### Contributors - [@​j178](https://github.com/j178) - [@​xiaoyanli-lyft](https://github.com/xiaoyanli-lyft) - [@​Lutra-Fs](https://github.com/Lutra-Fs) ### [`v0.3.11`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#0311) [Compare Source](j178/prek@v0.3.10...v0.3.11) Released on 2026-04-27. ##### Highlights Hook entries now have an explicit `shell` option for shell snippets. Set `shell: sh`, `bash`, `pwsh`, `powershell`, or `cmd` when an entry should be evaluated by that shell; leaving it unset keeps prek's direct argv execution. `prek auto-update` can now filter tag candidates before choosing an update. Both options take glob patterns: use `--include-tag` to only consider matching tag names, and `--exclude-tag` to skip matching tags such as moving tags or prereleases. ##### Enhancements - Add `auto-update --exclude-repo <repo>` to skip repos ([#​1983](j178/prek#1983)) - Add `auto-update --exit-code` to exit with non-zero on updates ([#​2002](j178/prek#2002)) - Add `auto-update --include-tag <pattern>`/`--exclude-tag <pattern>` to filter tags ([#​1984](j178/prek#1984)) - Adds an explicit `shell` hook option for entries that should run as shell source ([#​2004](j178/prek#2004)) - Make `--hook-dir` optional for hook-impl ([#​1989](j178/prek#1989)) - Skip shim warning when `--script-version` is missing ([#​1990](j178/prek#1990)) ##### Bug fixes - Install Ruby executable in gem bin ([#​2017](j178/prek#2017)) - Use dedicated Android npm package ([#​1982](j178/prek#1982)) - Use stable repo keys without breaking cached clones ([#​1995](j178/prek#1995)) ##### Documentation - Explain prek name ([#​1980](j178/prek#1980)) - Clarify `pass_filenames` concurrency docs ([#​1999](j178/prek#1999)) - Reorganize documentation references ([#​2005](j178/prek#2005)) - Clarify hook author manifest env docs ([#​1991](j178/prek#1991)) - docs: add Sentry to users list ([#​1981](j178/prek#1981)) ##### Contributors - [@​j178](https://github.com/j178) ### [`v0.3.10`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#0310) [Compare Source](j178/prek@v0.3.9...v0.3.10) Released on 2026-04-21. ##### Enhancements - Disallow rev for non-remote repos in schema ([#​1964](j178/prek#1964)) - Hide up-to-date output in non-verbose mode ([#​1942](j178/prek#1942)) - Improve merge conflict marker detection ([#​1937](j178/prek#1937)) - Keep finished hooks visible ([#​1967](j178/prek#1967)) - Preserve frozen comment spacing in auto-update ([#​1945](j178/prek#1945)) - Reimplement `@j178/prek` npm package ([#​1973](j178/prek#1973)) ##### Bug fixes - Prefer stable Rust toolchains ([#​1974](j178/prek#1974)) ##### Documentation - Add `SKILL.md` for prek ([#​1950](j178/prek#1950)) - Document `gh skill install j178/prek prek` to install prek skill for agents ([#​1951](j178/prek#1951)) - Improve compatibility and migration docs ([#​1940](j178/prek#1940)) ##### Other changes - Sync latest identify tags ([#​1947](j178/prek#1947)) ##### Contributors - [@​github-actions](https://github.com/github-actions) - [@​renovate](https://github.com/renovate) - [@​j178](https://github.com/j178) ### [`v0.3.9`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#039) [Compare Source](j178/prek@v0.3.8...v0.3.9) Released on 2026-04-13. ##### Highlight `prek auto-update` is now stricter about pinned revisions and more useful in CI. It now keeps `rev` and `# frozen:` comments in sync, can detect [impostor commits](https://docs.zizmor.sh/audits/#impostor-commit) when validating pinned SHAs, and lets you use `prek auto-update --check` to fail on both available updates and frozen-ref mismatches without rewriting the config. Examples: ```console $ prek auto-update # updates revs and repairs stale `# frozen:` comments $ prek auto-update --freeze # writes frozen SHAs with matching `# frozen: <tag>` comments $ prek auto-update --check # exits non-zero when updates are available, a `# frozen:` comment is stale, # or a pinned SHA does not belong to the fetched upstream refs ``` ##### Enhancements - Check and sync frozen comments during auto-update ([#​1896](j178/prek#1896)) - Handle impostor commits in auto-update ([#​1919](j178/prek#1919)) - Add experimental `language: dotnet` support ([#​1871](j178/prek#1871)) - Honor repo and worktree `core.hooksPath` ([#​1892](j178/prek#1892)) - Add `prek run --no-fail-fast` to override config file ([#​1859](j178/prek#1859)) - Add `forbid-new-submodules` as builtin hook ([#​1853](j178/prek#1853)) - Clean stale patch files in `cache gc` ([#​1877](j178/prek#1877)) - Display auto-update results by config entry ([#​1922](j178/prek#1922)) - Restrict patch directory permissions ([#​1876](j178/prek#1876)) - Show tag names in `auto-update --freeze` output ([#​1916](j178/prek#1916)) - Use a bitset for hook stages ([#​1860](j178/prek#1860)) ##### Bug fixes - Canonicalize CWD and GIT\_ROOT paths ([#​1878](j178/prek#1878)) - Ensure quotes are added for non-string revisions in `auto-update` ([#​1936](j178/prek#1936)) ##### Documentation - Update docs for case of hooks modifying files with a non-zero exit code ([#​1879](j178/prek#1879)) ##### Contributors - [@​RicardoVercetti](https://github.com/RicardoVercetti) - [@​nathanjmcdougall](https://github.com/nathanjmcdougall) - [@​renovate](https://github.com/renovate) - [@​sadjow](https://github.com/sadjow) - [@​j178](https://github.com/j178) ### [`v0.3.8`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#038) [Compare Source](j178/prek@v0.3.6...v0.3.8) Released on 2026-03-23. ##### Enhancements - Add experimental `language: deno` support ([#​1516](j178/prek#1516)) - Add `pretty-format-json` as builtin hook ([#​915](j178/prek#915)) - Add `check-vcs-permalinks` as builtin hook ([#​1842](j178/prek#1842)) - Add `check-illegal-windows-names` as builtin hook ([#​1841](j178/prek#1841)) - Add `check-shebang-scripts-are-executable` builtin hook ([#​1847](j178/prek#1847)) - Add `destroyed-symlinks` builtin hook ([#​1851](j178/prek#1851)) - Add `file-contents-sorter` as builtin hook ([#​1846](j178/prek#1846)) - Add `--all` flag to `prek uninstall` ([#​1817](j178/prek#1817)) - Improve file pattern parse errors ([#​1829](j178/prek#1829)) - Validate `uv` binary after download ([#​1825](j178/prek#1825)) ##### Bug fixes - Fix workspace-relative added file paths ([#​1852](j178/prek#1852)) - Relax alias-anchor ratio check for check-yaml ([#​1839](j178/prek#1839)) ##### Contributors - [@​j178](https://github.com/j178) - [@​shaanmajid](https://github.com/shaanmajid) - [@​mvanhorn](https://github.com/mvanhorn) - [@​feliblo](https://github.com/feliblo) - [@​Tiryoh](https://github.com/Tiryoh) ### [`v0.3.6`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#036) [Compare Source](j178/prek@v0.3.5...v0.3.6) Released on 2026-03-16. ##### Enhancements - Allow selectors for hook ids containing colons ([#​1782](j178/prek#1782)) - Rename `prek install-hooks` to `prek prepare-hooks` and `prek install --install-hooks` to `prek install --prepare-hooks` ([#​1766](j178/prek#1766)) - Retry auth-failed repo clones with terminal prompts enabled ([#​1761](j178/prek#1761)) ##### Performance - Optimize `detect_private_key` by chunked reading and using aho-corasick ([#​1791](j178/prek#1791)) - Optimize `fix_byte_order_marker` by shifting file contents in place ([#​1790](j178/prek#1790)) ##### Bug fixes - Align stage defaulting behavior with pre-commit ([#​1788](j178/prek#1788)) - Make sure child output is drained in the PTY subprocess ([#​1768](j178/prek#1768)) - fix(golang): use `GOTOOLCHAIN=local` when probing system go ([#​1797](j178/prek#1797)) ##### Documentation - Disambiguate “hook” terminology by renaming "Git hooks" to "Git shims" ([#​1776](j178/prek#1776)) - Document compatibility with pre-commit ([#​1767](j178/prek#1767)) - Update configuration.md with TOML 1.1 notes ([#​1764](j178/prek#1764)) ##### Other changes - Sync latest identify tags ([#​1798](j178/prek#1798)) ##### Contributors - [@​github-actions](https://github.com/github-actions) - [@​j178](https://github.com/j178) - [@​pcastellazzi](https://github.com/pcastellazzi) - [@​deadnews](https://github.com/deadnews) - [@​copilot-swe-agent](https://github.com/copilot-swe-agent) ### [`v0.3.5`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#035) [Compare Source](j178/prek@v0.3.4...v0.3.5) Released on 2026-03-09. ##### Enhancements - Add automatic Ruby download support using rv binaries ([#​1668](j178/prek#1668)) - Adjust open file limit on process startup ([#​1705](j178/prek#1705)) - Allow parallel gem retry ([#​1732](j178/prek#1732)) - Enable system-proxy feature on reqwest ([#​1738](j178/prek#1738)) - Expose `--git-dir` to force hook installation target ([#​1723](j178/prek#1723)) - Pass `--quiet`, `--verbose`, and `--no-progress` through `prek install` into generated hook scripts ([#​1753](j178/prek#1753)) - Respect `core.sharedRepository` for hook permissions ([#​1755](j178/prek#1755)) - Support legacy mode hook script ([#​1706](j178/prek#1706)) - rust: support `cli:` git dependency 4th segment package disambiguation ([#​1747](j178/prek#1747)) ##### Bug fixes - Fix Python `__main__.py` entry ([#​1741](j178/prek#1741)) - python: strip `UV_SYSTEM_PYTHON` from `uv venv` and `pip install` commands ([#​1756](j178/prek#1756)) ##### Other changes - Sync latest identify tags ([#​1733](j178/prek#1733)) ##### Contributors - [@​Dev-iL](https://github.com/Dev-iL) - [@​tennox](https://github.com/tennox) - [@​shaanmajid](https://github.com/shaanmajid) - [@​is-alnilam](https://github.com/is-alnilam) - [@​github-actions](https://github.com/github-actions) - [@​j178](https://github.com/j178) ### [`v0.3.4`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#034) [Compare Source](j178/prek@v0.3.3...v0.3.4) Released on 2026-02-28. ##### Enhancements - Allow `pass_filenames` to accept a positive integer ([#​1698](j178/prek#1698)) - Install and compile gems in parallel ([#​1674](j178/prek#1674)) - Sync identify file-type mappings with pre-commit identify ([#​1660](j178/prek#1660)) - Use `--locked` for Rust `cargo install` commands ([#​1661](j178/prek#1661)) - Add `PREK_MAX_CONCURRENCY` environment variable for configuring maximum concurrency ([#​1697](j178/prek#1697)) - Add `PREK_LOG_TRUNCATE_LIMIT` environment variable for configuring log truncation ([#​1679](j178/prek#1679)) - Add support for `python -m prek` ([#​1686](j178/prek#1686)) ##### Bug fixes - Skip invalid Rust toolchains instead of failing ([#​1699](j178/prek#1699)) ##### Performance - Bitset-based TagSet refactor: precompute tag masks and speed up hook type filtering ([#​1665](j178/prek#1665)) ##### Documentation - Document `winget install j178.Prek` ([#​1670](j178/prek#1670)) ##### Contributors - [@​uplsh580](https://github.com/uplsh580) - [@​Svecco](https://github.com/Svecco) - [@​dbast](https://github.com/dbast) - [@​drichardson](https://github.com/drichardson) - [@​JP-Ellis](https://github.com/JP-Ellis) - [@​j178](https://github.com/j178) - [@​is-alnilam](https://github.com/is-alnilam) - [@​copilot-swe-agent](https://github.com/copilot-swe-agent) ### [`v0.3.3`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#033) [Compare Source](j178/prek@v0.3.2...v0.3.3) Released on 2026-02-15. ##### Enhancements - Read Python version specifier from hook repo `pyproject.toml` ([#​1596](j178/prek#1596)) - Add `#:schema` directives to generated prek.toml ([#​1597](j178/prek#1597)) - Add `prek util list-builtins` command ([#​1600](j178/prek#1600)) - Expand install source detection to `mise`, `uv tool`, `pipx`, and `asdf` ([#​1605](j178/prek#1605), [#​1607](j178/prek#1607)) - Add progress bar to `cache clean` and show removal summary ([#​1616](j178/prek#1616)) - Make `yaml-to-toml` CONFIG argument optional ([#​1593](j178/prek#1593)) - `prek uninstall` removes legacy scripts too ([#​1622](j178/prek#1622)) ##### Bug fixes - Fix underflow when formatting summary output ([#​1626](j178/prek#1626)) - Match `files/exclude` filter against relative path of nested project ([#​1624](j178/prek#1624)) - Select `musllinux` wheel tag for uv on musl-based distros ([#​1628](j178/prek#1628)) ##### Documentation - Clarify `prek list` description ([#​1604](j178/prek#1604)) ##### Contributors - [@​ichoosetoaccept](https://github.com/ichoosetoaccept) - [@​shaanmajid](https://github.com/shaanmajid) - [@​soraxas](https://github.com/soraxas) - [@​9999years](https://github.com/9999years) - [@​j178](https://github.com/j178) ### [`v0.3.2`](https://github.com/j178/prek/blob/HEAD/CHANGELOG.md#032) [Compare Source](j178/prek@v0.3.1...v0.3.2) Released on 2026-02-06. ##### Highlights - **`prek.toml` is here!** You can now use `prek.toml` as an alternative to `.pre-commit-config.yaml` for configuring prek. `prek.toml` mirrors the structure of `.pre-commit-config.yaml`, but TOML is less error-prone. Your existing `.pre-commit-config.yaml` will continue to work, but for new users and new projects, `prek.toml` may make more sense. If you want to switch, run `prek util yaml-to-toml` to convert YAML configs to `prek.toml`. See [configuration docs](configuration.md) for details. For example, this config: ```yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: check-yaml ``` Can be written as `prek.toml` like this: ```toml [[repos]] repo = "https://github.com/pre-commit/pre-commit-hooks" rev = "v6.0.0" hooks = [ { id = "check-yaml" } ] ``` - **`serde-yaml` has been replaced with `serde-saphyr`** We replaced the long-deprecated `serde-yaml` crate with [`serde-saphyr`](https://crates.io/crates/serde-saphyr) for YAML parsing. It is written in safe Rust and has better error messages, performance, and security. This lets us provide precise location information for configuration parsing errors, which should make it easier to fix config issues. For example, this invalid config: ```yaml repos: - repo: https://github.com/crate-ci/typos hooks: - id: typos ``` Before: ```console $ prek run error: Failed to parse `.pre-commit-config.yaml` caused by: Invalid remote repo: missing field `rev` ``` Now: ```console $ prek run error: Failed to parse `.pre-commit-config.yaml` caused by: error: line 2 column 5: missing field `rev` at line 2, column 5 --> <input>:2:5 | 1 | repos: 2 | - repo: https://github.com/crate-ci/typos | ^ missing field `rev` at line 2, column 5 3 | hooks: 4 | - id: typos | ``` - **`prek util` subcommands** We added a new `prek util` top-level command for miscellaneous utilities that don't fit into other categories. The first two utilities are: - `prek util identify`: shows the identification tags of files that prek uses for file filtering, which can be useful for debugging and writing `types/types_or/exclude_types` filters. - `prek util yaml-to-toml`: converts `.pre-commit-config.yaml` to `prek.toml`. We also moved `prek init-template-dir` under `prek util` for better organization. The old `prek init-template-dir` command is still available (hidden) as an alias for backward compatibility. ##### Enhancements - Add `prek util identify` subcommand ([#​1554](j178/prek#1554)) - Add `prek util yaml-to-toml` to convert `.pre-commit-config.yaml` to `prek.toml` ([#​1584](j178/prek#1584)) - Detect install source for actionable upgrade hints ([#​1540](j178/prek#1540)) - Detect prek installed by the standalone installer ([#​1545](j178/prek#1545)) - Implement `serialize_yaml_scalar` using `serde-saphyr` ([#​1534](j178/prek#1534)) - Improve max cli arguments length calculation ([#​1518](j178/prek#1518)) - Move `identify` and `init-template-dir` under the `prek util` top-level command ([#​1574](j178/prek#1574)) - Replace serde-yaml with serde-saphyr (again) ([#​1520](j178/prek#1520)) - Show precise location for config parsing error ([#​1530](j178/prek#1530)) - Support `Julia` language ([#​1519](j178/prek#1519)) - Support `prek.toml` ([#​1271](j178/prek#1271)) - Added `PREK_QUIET` environment variable support ([#​1513](j178/prek#1513)) - Remove upper bound constraint of uv version ([#​1588](j178/prek#1588)) ##### Bug fixes - Do not make the child a session leader ([#​1586](j178/prek#1586)) - Fix FilePattern schema to accept plain strings ([#​1564](j178/prek#1564)) - Use semver fallback sort when tag timestamps are equal ([#​1579](j178/prek#1579)) ##### Documentation - Add `OpenClaw` to the list of users ([#​1517](j178/prek#1517)) - Add `cachix/devenv`, `apache/lucene`, `copper-project/copper-rs` as projects using prek ([#​1531](j178/prek#1531), [#​1514](j178/prek#1514), [#​1569](j178/prek#1569)) - Add document about authoring remote hooks ([#​1571](j178/prek#1571)) - Add `llms.txt` generation for LLM-friendly documentation ([#​1553](j178/prek#1553)) - Document using `--refresh` to pick up `.prekignore` changes ([#​1575](j178/prek#1575)) - Fix PowerShell completion instruction syntax ([#​1568](j178/prek#1568)) - Update quick start to use `prek.toml` ([#​1576](j178/prek#1576)) ##### Other changes - Include `prek.toml` in run hint for config filename ([#​1578](j178/prek#1578)) ##### Contributors - [@​fatelei](https://github.com/fatelei) - [@​domenkozar](https://github.com/domenkozar) - [@​makeecat](https://github.com/makeecat) - [@​fllesser](https://github.com/fllesser) - [@​j178](https://github.com/j178) - [@​copilot-swe-agent](https://github.com/copilot-swe-agent) - [@​oopscompiled](https://github.com/oopscompiled) - [@​rmuir](https://github.com/rmuir) - [@​shaanmajid](https://github.com/shaanmajid) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjguNSIsInVwZGF0ZWRJblZlciI6IjQzLjE2OC41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Current Ruby support can only use Ruby interpreters which are already installed on the system, although it goes to great lengths to find interpreters installed by a variety of Ruby managers. This change adds support for installing new interpreters using the binaries delivered by the
rvteam.rvonly provide installers for versions of Ruby still actively supported (so they don't offer version 3.1, for example), and only build for a subset of all Ruby-supported platforms. If users need an unsupported version of Ruby or wish to use an unsupported platform, they will be prompted to download and install a version of Ruby manually.rvbundles are named according to the platform, currently including these components in the filename:If and when upstream
rvchanges these names, the detection code will need to be updated to match. In particular, this includes the use of macOS codenames, as ifrvstop releasing a 'sonoma' package, this will block installing the macOS versions of Ruby. Currentlyrvseem to be attempting to keep these codenames, as they already rename their x86_64 builds from 'sequoia' (macOS 15) to 'ventura' (macOS 13). Adding a new CPU architecture (such as RISC-V) would also need changes, but wouldn't break existing platform support.Ruby versions are found by querying the GitHub Releases API, searching the options returned for an installer that matches the platform and version requirements, then, if found, downloading and unpacking into the
prektools folder. ThePREK_RUBY_MIRRORenvironment variable can be used to point to a different source for installers, for example to support mirrors or air-gapped CI environments. Mirrors need to follow the GitHub URL patterns, but note that although the GitHub hostname changes betweenapi.github.comandgithub.comas needed, any non-GitHub mirror server will not be remapped in this manner. Where Ruby is being downloaded from GitHub (either from the upstreamrvor a mirror), this remapping does occur, and anyGITHUB_TOKENwill be sent with the requests. This both limits impact of rate limiting, and also allows a private GitHub repository to be used (e.g. for a vetted subset ofrvrubies to be mirrored). Note that GitHub tokens will only be sent to mirrors which are hosted on GitHub.To allow for passing the
GITHUB_TOKENin download requests, the genericdownload_and_extractfunction is now a wrapper over a version which takes an extension function, with the default function not extending the request. The Ruby code will add the GitHub token if the request is to GitHub.Closes #43
Closes #765