123456789_123456789_123456789_123456789_123456789_

Module: RubyInstaller::Build::Colors

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/ruby_installer/build/colors.rb

Constant Summary

Class Method Summary

Class Method Details

.colored(color, string) (mod_func)

[ GitHub ]

  
# File 'lib/ruby_installer/build/colors.rb', line 34

def colored(color, string)
  @colors_on = $stdout.tty? if @colors_on.nil?
  if @colors_on
    c = ColorMap[color] || color
    "#{ESC}#{30+c}m#{string}#{NND}"
  else
    string.dup
  end
end

.disable_colors (mod_func)

[ GitHub ]

  
# File 'lib/ruby_installer/build/colors.rb', line 48

def disable_colors
  @colors_on = false
end

.enable_colors (mod_func)

[ GitHub ]

  
# File 'lib/ruby_installer/build/colors.rb', line 44

def enable_colors
  @colors_on = true
end

.initialize(*_, **_) (mod_func)

[ GitHub ]

  
# File 'lib/ruby_installer/build/colors.rb', line 29

def initialize(*_, **_)
  super
  @colors_on = nil
end