I'm developing an application in Ruby. It is used at the command line and has a lot of options, some of them fairly complex. I'd like to provide the ability to use the application through a web interface.
So I'm asking the general question of the best way to do that, or if there might be a better way to do this.
The idea I'm currently working with is that the application would fork itself and use WEBrick to create an http server on some 1024+ port. Then, in the parent process, it would launch the user's web browser using sensible-browser, sending the browser to localhost:port.
The user uses the web application. When they click some particular button (probably "save") then the server would send a final page and shut itself down. That last message would include a message telling the user to close the browser.
The parent process sees that the browser and server processes have closed and proceeds to use the information that was saved to some local file.
All that sounds rather complicated, which is why I'm not crazy about the idea. However, I'm setting out to create a really easy interface, which means not requiring the user to learn a bunch of command line parameters (though I probably will provide those too).
I can't find any gems that provides cursors-based forms, which is why I'm considering the web browser concept.
Opinions?