Module: Locomotive::Wagon::CLI::ForceColor

Instance Method Summary collapse

Instance Method Details

#force_color_if_asked(options) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/locomotive/wagon/cli.rb', line 37

def force_color_if_asked(options)
  if options[:force_color]
    # thor
    require 'locomotive/wagon/tools/thor'
    self.shell = Thor::Shell::ForceColor.new

    # bypass colorize code
    STDOUT.instance_eval { def isatty; true; end; }
  end
end