Module: Clack::Core::CiMode
- Defined in:
- lib/clack/core/ci_mode.rb
Overview
Non-interactive mode for CI environments and piped input.
When enabled, prompts auto-submit with their default values instead of waiting for user input. Useful for CI pipelines, automated testing, and scripted usage where stdin isn't a TTY.
Enable explicitly:
Clack.update_settings(ci_mode: true)
Or auto-detect (non-TTY input or CI environment variable):
Clack.update_settings(ci_mode: :auto)
Class Method Summary collapse
-
.active?(input = $stdin) ⇒ Boolean
Check if CI mode is currently active.
Class Method Details
.active?(input = $stdin) ⇒ Boolean
Check if CI mode is currently active.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/clack/core/ci_mode.rb', line 24 def active?(input = $stdin) setting = Settings.config[:ci_mode] case setting when true true when :auto !Environment.tty?(input || $stdin) || Environment.ci? else false end end |