Best gem for working with ncurses and ruby

坚强是说给别人听的谎言 提交于 2019-12-10 12:45:58

问题


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?


回答1:


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.




回答2:


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




回答3:


This one appears to have the best readme https://github.com/seanohalpin/ffi-ncurses



来源:https://stackoverflow.com/questions/9398076/best-gem-for-working-with-ncurses-and-ruby

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!