Fixed CLI crashing after gem install - #14
Draft
HassanAkbar wants to merge 4 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a packaging/runtime issue where the installed dcc executable could crash on startup due to a missing runtime dependency, by aligning CLI require usage with gem runtime dependencies and adding a regression spec to prevent recurrence.
Changes:
- Adds
tty-tableas a runtime dependency indcc.gemspec. - Removes an unused
require "tty-table"fromlib/dcc/cli/cli.rb(leavingtty-tablerequired only where actually needed). - Adds a spec that scans
lib/dcc/cli/**for third-partyrequires and asserts they are declared runtime dependencies.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/dcc/cli/dependencies_spec.rb | New guard spec to ensure CLI load-time requires map to gem runtime dependencies. |
| lib/dcc/cli/cli.rb | Removes the tty-table require from CLI entrypoint. |
| Gemfile | Drops tty-table from dev-only Gemfile dependencies. |
| dcc.gemspec | Declares tty-table as a runtime dependency for packaged installs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
HassanAkbar
marked this pull request as ready for review
August 11, 2026 15:30
HassanAkbar
marked this pull request as draft
August 11, 2026 15:34
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
spec/dcc/cli/dependencies_spec.rb:14
rootcurrently resolves to<repo>/spec(since this file lives underspec/dcc/cli), soGem::Specification.load(File.join(root, "dcc.gemspec"))will look forspec/dcc.gemspecand return nil/error. The gemspec is at the repository root (dcc.gemspec), so this spec will fail as written.
let(:root) { File.expand_path("../../..", __dir__) }
let(:gemspec) { Gem::Specification.load(File.join(root, "dcc.gemspec")) }
let(:declared) { gemspec.runtime_dependencies.map(&:name) }
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.
gem install dccproduced a binary that crashed on every command, includingdcc version.cli.rbrequiredtty-table, which was only a Gemfile development dependency.exe/dccloads that file directly, so every command died withLoadError.cli.rb, which never usedTTY::Table.formatters.rbloads it on first use and falls back to its own plain renderer,with a note on stderr pointing at
gem install tty-table.Known and accepted:
tty-tablestays out of the gemspec. It costs 8 further gems that every libraryuser would install just to parse XML. It joins the Gemfile's existing
:optionalgroup beside
sinatraandtty-prompt.