Skip to content

Apply terminal detection for the refinement entry point - #149

Open
OskarEichler wants to merge 1 commit into
ku1ik:masterfrom
OskarEichler:codex/rainbow-refinement-init
Open

Apply terminal detection for the refinement entry point#149
OskarEichler wants to merge 1 commit into
ku1ik:masterfrom
OskarEichler:codex/rainbow-refinement-init

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Route the documented standalone require 'rainbow/refinement' entry point through Rainbow's normal initialization so it honors TTY detection, TERM=dumb, and CLICOLOR_FORCE.

Reproduction

With output redirected, require 'rainbow' disables formatting, but require 'rainbow/refinement'; using Rainbow currently leaves formatting enabled because it loads global directly and skips lib/rainbow.rb initialization.

Verification

  • Existing suite: 220 examples, 0 failures on Ruby 3.2.11 and 4.0.6.
  • RuboCop: 15 files, 0 offenses on both Rubies.
  • External isolated-process model: 66 checks per Ruby covering STDOUT/STDERR TTY combinations, normal/dumb terminals, force values, both require orders, real redirected output, and explicit post-require enable/disable. Current master/release fail 15 cases per Ruby; this branch passes all.
  • Rebuilt gem: 14 expected files and successful packaged loads on both Rubies.
  • No test files changed.

Compatibility

No API break. The refinement entry point now follows the same documented automatic enable/disable policy as require 'rainbow'. Explicit Rainbow.enabled= overrides remain effective.

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.

1 participant