lib/guard/ui.rb
def color_enabled?
        if @color_enabled.nil?
          if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
            if ENV['ANSICON']
              @color_enabled = true
            else
              begin
                require 'rubygems' unless ENV['NO_RUBYGEMS']
                require 'Win32/Console/ANSI'
                @color_enabled = true
              rescue LoadError
                @color_enabled = false
                info "You must 'gem install win32console' to use color on Windows"
              end
            end
          else
            @color_enabled = true
          end
        end

        @color_enabled
      end
# Checks if color output can be enabled.
#
# @return [Boolean] whether color is enabled or not
#
Checks if color output can be enabled.
Checks if color output can be enabled .
def color_enabled?
        if @color_enabled.nil?
          if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
            if ENV['ANSICON']
              @color_enabled = true
            else
              begin
                require 'rubygems' unless ENV['NO_RUBYGEMS']
                require 'Win32/Console/ANSI'
                @color_enabled = true
              rescue LoadError
                @color_enabled = false
                info "You must 'gem install win32console' to use color on Windows"
              end
            end
          else
            @color_enabled = true
          end
        end
        @color_enabled
      end
def color_enabled? if @color_enabled . nil? if RbConfig :: CONFIG [ 'target_os' ] =~ / mswin|mingw /i if ENV [ 'ANSICON' ] @color_enabled = true else begin require 'rubygems' unless ENV [ 'NO_RUBYGEMS' ] require 'Win32/Console/ANSI' @color_enabled = true rescue LoadError @color_enabled = false info "You must 'gem install win32console' to use color on Windows" end end else @color_enabled = true end end @color_enabled end
Checks if color output can be enabled.
Checks if color output can be enabled .
whether color is enabled or not
whether color is enabled or not
Boolean