Ruby Dialog Interface
Get Version
0.5.0
→ ‘rdialog’
What
Interface with the command-line curses interface dialog, and rapidly develop simple dialog-driven TUI applications
Installing
Install dialog on your machine.
sudo gem install rdialog
The basics
After installation is complete, require the gem in your source code, and away you go!
RDialog handles the interface between ruby scripts and dialog’s command-line interface. RDialog accepts input as arrays and/or strings, and returns similar objects.
Once you have initialized an instance of RDialog via
RDialog.new, options can be set that will persist throughout the lifetime of the instace. For example:
dialog = RDialog.new dialog.shadow = false
This will prevent dialog from drawing shadows around all further boxes.
Demonstration of usage
require "rdialog"
items = Array.new
items.push(["softcheese.net", "a cool server", false])
items.push(["filter.eu.org", "an even cooler server!", false])
items.push(["oink.me.uk", "quite cool as well", true])
dialog = RDialog.new
dialog.nocancel = true
selected_item = dialog.radiolist("ssh to:", items)
exec("ssh sweeper@" + selected_item)
Forum
http://groups.google.com/group/rdialog
Licence
This code is free to use under the terms of the MIT licence.
Contact
Comments are welcome. Send an email to Aleks Clark.
Dr Nic, 21st May 2007
Theme extended from Paul Battley