Imported from xeger/backticks (
AGENTS.md). Install upstream withnpx skills add xeger/backticks. Copyright stays with the author.
Backticks
Ruby gem providing an OOP wrapper for command-line processes with PTY support.
Development
bundle install
bundle exec rake spec
Project Structure
lib/backticks/- gem source;runner.rbspawns processes,command.rbmanages running commandsspec/- RSpec tests;runner_spec.rbis pure unit tests with mocked PTY/IO,command_spec.rbmixes unit and functional tests with real subprocessesbackticks.gemspec- gem metadata; version is inlib/backticks/version.rb
CI
GitHub Actions runs specs against Ruby 3.2, 3.3, and head on every push/PR to master.
Releasing
- Bump
VERSIONinlib/backticks/version.rb - Commit and push to master
- Go to Actions > Release > "Run workflow"
The workflow reads the version from source, publishes to RubyGems via trusted publisher, then creates the GitHub release. Do not create releases manually; the workflow is the single source of truth for the release tag.
PTY Considerations
This gem uses PTY for unbuffered I/O. Tests that mock IO.select must ensure stdout/stderr are still drained, or Command#join will loop forever waiting for eof?. In CI (no TTY), STDIN.tty? returns false, which changes capture() behavior. See the given interactive is true tests in command_spec.rb for the pattern.
