Module: Foreman::Engine::CLI::Color

### Home Classes Methods

### In Files

- lib/foreman/engine/cli.rb

### Methods

- ::enable
- #color
- #color?

### Class/Module Index

Quicksearch

- Foreman
- Foreman::AppDoesNotExist
- Foreman::CLI
- Foreman::Distribution
- Foreman::Engine
- Foreman::Engine::CLI
- Foreman::Engine::CLI::Color
- Foreman::Export
- Foreman::Export::Base
- Foreman::Export::Bluepill
- Foreman::Export::Exception
- Foreman::Export::Inittab
- Foreman::Export::Launchd
- Foreman::Export::Runit
- Foreman::Export::Supervisord
- Foreman::Export::Upstart
- Foreman::Helpers
- Foreman::Process
- Foreman::Procfile

No matching classes.

# Foreman::Engine::CLI::Color

### Constants

ANSI

### Public Class Methods

enable(io, force=false) click to toggle source

    # File lib/foreman/engine/cli.rb, line 27
    def self.enable(io, force=false)
      io.extend(self)
      @@color_force = force
    end

### Public Instance Methods

color(name) click to toggle source

    # File lib/foreman/engine/cli.rb, line 39
    def color(name)
      return "" unless color?
      return "" unless ansi = ANSI[name.to_sym]
      "\e[#{ansi}m"
    end

color?() click to toggle source

    # File lib/foreman/engine/cli.rb, line 32
    def color?
      return true if @@color_force
      return false if Foreman.windows?
      return false unless self.respond_to?(:isatty)
      self.isatty && ENV["TERM"]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.