RubyText is a curses wrapper. The modern variant is ncurses, and there are also others. This tutorial doesn't cover much of "real" curses, as the aim is to wrap it and make it simpler.
This project is somewhat in its infancy. Once it is a little more mature, I hope to produce an Elixir version. (Elixir is not usually used at the desktop, but it can be.)
Let's start at the beginning with the overused "hello world" example.
Here are some things to notice:
The start method can take a number of parameters, some of which are keyword arguments. If you know curses, some of these will be familiar, while others provide functionality unrelated to what curses provides.
The defaults are as follows:
RubyText.start(:cbreak, :_raw, :_echo, :keypad, log: "/tmp/rubytext.log", fg: White, bg: Blue, scroll: true) # can be abbreviated simply: RubyText.startIf you're a relative curses newbie (like me), you may have some confusion about the cbreak and raw modes. Let's clear it up a little with these four facts.
The standard curses implementation recognizes eight colors: Black, Blue, Cyan, Green, Magenta, Red, White, Yellow. Each of these constants refers to a symbol of the same (lowercased) name. What these colors look like in your own local environment may depend on many factors such as your operating system and terminal driver.
My own environment is iterm on Mac OSX with fairly standard settings. Here is some code that will display all 64 possibilities of foreground/background. (Note that curses seems to "cheat" when these two are the same, presumably to preserve legibility.)
That's all for now.