OSC 7501 for Ruby
Add terminal status to an existing Ruby project's Rake tasks.
Use a terminal that supports OSC 7501 and a project with a Gemfile and Rakefile. Add this to the Gemfile:
gem 'rake-osc7501'
Install the gem:
bundle install
Add the require to the Rakefile:
require 'rake/osc7501'
Run a task defined by your project, for example bundle exec rake test. The terminal can show task activity and the final result while ordinary output continues. The reporter emits status by default when stdout is a TTY and TERM is not dumb. Terminal support determines how status appears.
To inspect emitted records without terminal support, replace test with a task your project defines:
RAKE_OSC7501=force bundle exec rake test | cat -v
Look for ^[]7501; records and a final state=done or state=error. An interruption or early successful exit reports state=idle. See Rake for limits and output controls. For RSpec tasks run by Rake, the combined setup reports the suite as a child.
For direct RSpec runs or Thor commands, use the RSpec or Thor guide. The RuboCop adapter is underway and has not been released as a gem.