[ANN] CursWrap [n]Curses module

This weekend I wrote a ruby module that aims to provide a friendlier
interface to the [n]Curses terminal I/O library.

Currently it supports the basic wholesome goodness that’s required to
get keystroke input, and to put all sorts of colorful text and
characters anywhere on the screen (though due to Curses’s weird
COLOR_PAIR system, I haven’t yet added support for background colors
other than black (though right now I’m smacking my forehead for
forgetting to add support for reverse-video, which, while not as nice
as being able to support arbitrary foreground-background color pairs
on-the-fly, still seems like something nice to have. Reverse-video
will be in the next release, I promise. :slight_smile:

Also, the module has built-in signal handlers to gracefully (and
automatically) handle things like xterm resizes, and keyboard
interrupts (apparently nCurses “steals” SIGINT from ruby – this
module’s signal handler simply gives it back, as an Interrupt
exception that you can rescue like any other.)

Download CursWrap at:

http://drphoto.homeunix.net/software/curswrap-0.1.1.tar.bz2

(The 0.1.1 is completely arbitrary… :wink:

Refer to Build.txt for instructions on compiling the module
(Essentialy just the typical ./extconf.rb && make ), and Doc.txt for
a reference on module functions, constants, and class(es).

Bug reports, feature requests, comments, suggestions, critique, and
rants are appreciated. (Well, maybe not so much the rants… :slight_smile:

Most importantly, if you like this module, or find it useful or
helpful, let me know! :slight_smile:

How does it compare to the standard curses module (comes with the
distribution) and ncurses module
(at http://raa.ruby-lang.org/list.rhtml?name=ncurses-ruby)?

···

----- Original Message -----
From: “Julian Snitow” vangczung@yahoo.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, March 17, 2003 4:49 PM
Subject: [ANN] CursWrap [n]Curses module

This weekend I wrote a ruby module that aims to provide a friendlier
interface to the [n]Curses terminal I/O library.

Currently it supports the basic wholesome goodness that’s required to
get keystroke input, and to put all sorts of colorful text and
characters anywhere on the screen (though due to Curses’s weird
COLOR_PAIR system, I haven’t yet added support for background colors
other than black (though right now I’m smacking my forehead for
forgetting to add support for reverse-video, which, while not as nice
as being able to support arbitrary foreground-background color pairs
on-the-fly, still seems like something nice to have. Reverse-video
will be in the next release, I promise. :slight_smile:

Also, the module has built-in signal handlers to gracefully (and
automatically) handle things like xterm resizes, and keyboard
interrupts (apparently nCurses “steals” SIGINT from ruby – this
module’s signal handler simply gives it back, as an Interrupt
exception that you can rescue like any other.)

Download CursWrap at:

http://drphoto.homeunix.net/software/curswrap-0.1.1.tar.bz2

(The 0.1.1 is completely arbitrary… :wink:

Refer to Build.txt for instructions on compiling the module
(Essentialy just the typical ./extconf.rb && make ), and Doc.txt for
a reference on module functions, constants, and class(es).

Bug reports, feature requests, comments, suggestions, critique, and
rants are appreciated. (Well, maybe not so much the rants… :slight_smile:

Most importantly, if you like this module, or find it useful or
helpful, let me know! :slight_smile:

Gennady wrote:

How does it compare to the standard curses module (comes with the
distribution) and ncurses module
(at http://raa.ruby-lang.org/list.rhtml?name=ncurses-ruby)?

CursWrap provides a higher-level interface than the default ‘curses’
module, and the ncurses module you mention. The idea is not to provide
a 1:1 mapping for each C function in the curses library, but instead to
abstract away most of the more painful “legacy” aspects of curses
programming (ever wonder why it’s called “Curses”? ;-), and expose the
useful functionality to the programmer via a cleaner, simpler interface.

I wrote curswrap because I’m not satisfied with the standard ‘curses’
module – IMO the C interface to Curses is in many ways needlessly
complex, and the standard ‘curses’ module in ruby mirrors the interface
too well (i.e., it’s every bit as painful to work with as the original :wink:

CursWrap aims to make curses programming less tedious, and more fun. :slight_smile:

Incidentally, curswrap now can be found at the RAA:
http://raa.ruby-lang.org/list.rhtml?name=curswrap

EHLO

  • On 2003-03-18 13:54

ever wonder why it’s called “Curses”? :wink:

The name seems to be of Klingon origin:

Klingon “pe’vIl mu’qaDmey tIbach” ("Curse well!) is roughly
comparable to “Good luck!”.

Litarally it means “Shoot curses forcefully!” - Curses are
considered a weapon of a sort which must be propelled to their
targets.

Source: “The Klingon Way” by Marc Okrand

and expose the useful functionality to the programmer via a
cleaner, simpler interface.

Sounds promising. I gave standard library’s curses a try but was not
very happy with it.

Josef ‘Jupp’ Schugt

···