Module: Cl::Ui

Defined in:
lib/cl/ui.rb

Defined Under Namespace

Modules: Colors Classes: Base, Pipe, Silent, Test, Tty

Class Method Summary collapse

Class Method Details

.new(ctx, opts) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/cl/ui.rb', line 5

def self.new(ctx, opts)
  const = Test if ctx.test?
  const ||= Silent if opts[:silent]
  const ||= Tty if $stdout.tty?
  const ||= Pipe
  const.new(opts)
end