lib/tty/color/support.rb
# Attempt to load curses to check color support
#
# @return [Boolean]
#
# @api private
Attempt to load curses to check color support
Attempt to load curses to check color support
def from_curses(curses_class = nil)
        return NoValue if TTY::Color.windows?
        require 'curses'
        if defined?(Curses)
          curses_class ||= Curses
          curses_class.init_screen
          has_color = curses_class.has_colors?
          curses_class.close_screen
          return has_color
        end
        NoValue
      rescue LoadError
        warn 'no native curses support' if @verbose
        NoValue
      end
def from_curses ( curses_class = nil ) return NoValue if TTY :: Color . windows? require 'curses' if defined? ( Curses ) curses_class ||= Curses curses_class . init_screen has_color = curses_class . has_colors? curses_class . close_screen return has_color end NoValue rescue LoadError warn 'no native curses support' if @verbose NoValue end
Attempt to load curses to check color support
Attempt to load curses to check color support
None
Boolean
curses_class
<not_specific>
api
None