Skip to content

Ship a concatenated dist/try.rb; gem is dist + bin - #139

Open
tobi wants to merge 1 commit into
mainfrom
dist-packaging
Open

Ship a concatenated dist/try.rb; gem is dist + bin#139
tobi wants to merge 1 commit into
mainfrom
dist-packaging

Conversation

@tobi

@tobi tobi commented Aug 16, 2026

Copy link
Copy Markdown
Owner

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 CLIGive Feedback 💬

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).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rb and route execution through bin/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 thread try-cli.gemspec
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 thread Makefile
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'; \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants