Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best gem for working with ncurses and ruby

Tags:

ruby

ncurses

I am interested in creating a command line application with ruby that would require moderately complex interaction with the user. I would like to use ncurses for this.

What is the best gem for working with ruby and ncurses, or should I be using stdlib utilities in ruby?

like image 666
transact Avatar asked Feb 22 '12 15:02

transact


2 Answers

Ruby includes bindings for the curses library. Despite what the name implies, it will use ncurses if possible.

Third party libraries often provide abstractions on top of either Ruby's curses or their own bindings. For example, ncursesw also wraps the panel, menu and form extensions. When I worked with Ruby's curses, I created my own Window class with proper border support.

If the basic methods are sufficient, I don't see any reason to add a dependency to your project. However, if you want to do fancy things more easily, you should use a library that provides support for what you need.

like image 124
Matheus Moreira Avatar answered Oct 19 '22 02:10

Matheus Moreira


I have found ncursesw on this Rubygems seach. Seems to be a good gem to start with.

like image 29
0xd Avatar answered Oct 19 '22 02:10

0xd