Module: Testprune::UI
- Defined in:
- lib/testprune/ui.rb,
lib/testprune/ui/styles.rb,
lib/testprune/ui/progress.rb,
lib/testprune/ui/error_toggle.rb,
lib/testprune/ui/report_renderer.rb
Overview
Terminal UI components built on lipgloss-ruby. All components degrade gracefully when NO_COLOR=1 is set or output is not a TTY.
Defined Under Namespace
Modules: Styles Classes: ErrorToggle, Progress, ReportRenderer
Class Method Summary collapse
-
.tty?(io = $stdout) ⇒ Boolean
Returns true when styled output is appropriate for the given IO.
Class Method Details
.tty?(io = $stdout) ⇒ Boolean
Returns true when styled output is appropriate for the given IO. Respects NO_COLOR (no-color.org/) and non-TTY output streams.
15 16 17 18 19 |
# File 'lib/testprune/ui.rb', line 15 def self.tty?(io = $stdout) return false if ENV['NO_COLOR'] io.respond_to?(:isatty) && io.isatty end |