Ship a concatenated dist/try.rb; gem is dist + bin - #139
Open
tobi wants to merge 1 commit into
Open
Conversation
Generate one working Ruby file at build time so Spinel has a single compilation unit and the published gem stays portable (bin/try + dist/try.rb).
There was a problem hiding this comment.
Pull request overview
This PR shifts the distributable artifact from split Ruby sources to a generated, single-file dist/try.rb, so the gem (and other packaging targets) ship a portable runtime while still supporting optional Spinel AOT compilation from one compilation unit.
Changes:
- Generate and ship a concatenated
dist/try.rband route execution throughbin/try(exec native binary when present, otherwise load the Ruby script). - Update build/test tooling (
make dist,rake dist, lint/spec tasks) to validate both split sources and the generated concat. - Align package managers (RubyGems, Homebrew, Nix) and docs to install/run via
bin/try+dist/try.rb.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| try-cli.gemspec | Switch gem contents to bin/try + generated dist/try.rb (and optional native binary). |
| README.md | Document new “split sources + build concat” workflow and packaging behavior. |
| Rakefile | Add dist build task and expand lint/spec to cover dist/try.rb. |
| Makefile | Add dist/dist-test, install updates, and build native from dist/try.rb. |
| Formula/try.rb | Homebrew installs bin/try plus dist/try.rb after running make dist. |
| flake.nix | Nix install now builds dist and installs bin/try + dist/try.rb. |
| bin/try | Router script: exec dist/try if present, otherwise load dist/try.rb. |
| AGENTS.md | Update contributor guidelines to reflect split sources + generated concat. |
| .github/workflows/release.yml | Ensure make dist runs before building/publishing the gem. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+20
to
+24
| # Generate the single-file script at build time. VERSION is read above from | ||
| # the repo; it is not shipped inside the installed gem. | ||
| Dir.chdir(__dir__) do | ||
| system("make", "dist/try.rb") or raise "failed to generate dist/try.rb (make dist)" | ||
| end |
Comment on lines
+42
to
+44
| printf '%s\n' '#!/usr/bin/env ruby'; \ | ||
| printf '%s\n' '# Generated by make dist. Do not edit.'; \ | ||
| printf '%s\n' '# Source: lib/tui.rb + lib/fuzzy.rb + try.rb'; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generate one working Ruby file at build time so Spinel has a single
compilation unit and the published gem stays portable (bin/try + dist/try.rb).
Stack created with GitHub Stacks CLI • Give Feedback 💬