Native ruby ncurses implementation
I know that there is ruby ncurses 开发者_Python百科library which accesses the C ncurses library, but is it possible to implement one pure ruby ncruses library? Any hints?
I'm also confused about the motivation for implementing a pure ruby ncurses library. That said, you have a few options:
curses is in the standard library. It's not as featureful as ncurses, but would provide a good base to build upon.
FFI would be a good way to get an ncurses wrapper going if compiling C extensions is what prohibits you from using the regular ruby ncurses library (looks like someone already started one).
Or, as @mu is too short commented, you could send the terminal control codes directly (I really can't see why this would ever be necessary or advisable though).
精彩评论