A Ruby binding for curses, ncurses, and PDCurses. curses is an extension library for text UI applications.
$ gem install curses
Requires ncurses or ncursesw (with wide character support). On Debian based distributions, you can install it with apt:
$ apt install libncurses5-dev
$ apt install libncursesw5-dev
gem install curses will install pre-built PDCurses, so you
don't need to install extra libraries.
After checking out the repo, run
bundle install to install dependencies.
To compile the extension library, run
bundle exec rake compile.
To install this gem onto your local machine, run
bundle exec rake install. To release a new version, update the version number in
curses.gemspec, and then run
bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the
.gem file to rubygems.org.
Cross compilation for Windows on Debian GNU/Linux based platforms
- Install development environment fo 32- and 64-bit Windows.
$ sudo apt-get install mingw-w64
- Install rake-compiler.
$ gem install rake-compiler
- Compile multiple versions of Ruby.
$ rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=2.2.6 $ rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=2.3.3 $ rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=2.4.0 $ rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=2.2.6 $ rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=2.3.3 $ rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=2.4.0
- Compile PDCurses.
$ rake build:pdcurses
- Compile curses.gem.
$ rake RUBY_CC_VERSION=2.3.3:2.4.0 cross clean compile native gem
Binary gems are generated in pkg/.
curses is released under the Ruby and 2-clause BSD licenses. See COPYING for details.
Binary gems for mingw32 include a forked version of PDCurses, which is in the public domain:
The version for Win32 console mode in the win32 subdirectory is used.