J
Joe Martin
Hello
I'm trying to create a console application with ruby on Windows. I wish
to have it menu driven, so each screen the user sees is essentially a
menu, where the user can enter a number (representing their menu
choice), such as:
-----------------------------
Welcome to my application!
Menu
1. Perform some action
2. View option list
3. Exit application
Enter selection> _
-----------------------------
Really I'm looking for skeleton or sample code for a console
application. A few google searches did return skeleton code for a
command-line and console applications, but everything I found was more
geared towards command line applications (that is, skeleton code for
parsing out parameters, proper help syntax, etc), and not creating a
menu-driven environment.
I already have the program basically written out and working, but it's
very hacky with many if-else and when-case checks, so I'm hoping that it
could be structured and written out in a cleaner fashion--just not quite
sure where to start, and I'm out of ideas on what other ways (or other
libraries) are viable options for me. The menus of this application wil
be multiple levels deep, so that needs to be kept in mind as well.
Any ideas on where to start? I'm willing to start the application from
scratch if the end result is cleaner, more standard code.
I'm trying to create a console application with ruby on Windows. I wish
to have it menu driven, so each screen the user sees is essentially a
menu, where the user can enter a number (representing their menu
choice), such as:
-----------------------------
Welcome to my application!
Menu
1. Perform some action
2. View option list
3. Exit application
Enter selection> _
-----------------------------
Really I'm looking for skeleton or sample code for a console
application. A few google searches did return skeleton code for a
command-line and console applications, but everything I found was more
geared towards command line applications (that is, skeleton code for
parsing out parameters, proper help syntax, etc), and not creating a
menu-driven environment.
I already have the program basically written out and working, but it's
very hacky with many if-else and when-case checks, so I'm hoping that it
could be structured and written out in a cleaner fashion--just not quite
sure where to start, and I'm out of ideas on what other ways (or other
libraries) are viable options for me. The menus of this application wil
be multiple levels deep, so that needs to be kept in mind as well.
Any ideas on where to start? I'm willing to start the application from
scratch if the end result is cleaner, more standard code.