Hi Jesse, definitely a very nice idea to doing the r magic stuff :D Regards Florian Jesse Merriman schrieb: > My solution uses SQLite to store a DB of names, and RMagick to display chosen > names. Consider the display part a first draft - I think I'll redo it, maybe > in a completely different way - and submit again later, though the backend > shouldn't change. > > There are 4 files that roughly follow MVC: > > names_db.rb: Wrapper around a SQLite::Database (M) > pick.rb: Main script (C) > pickerface.rb: Interface stuff (V) > name_image.rb: RMagick stuff (V) > > The DB stores just one thing: names. When a name is chosen, its simply deleted. > I thought of marking the names as either picked or unpicked, or storing chosen > names in another table, but I'm not sure if that would be used, and in any > event it would be easy enough to add if needed. > > When pick.rb is run without a command option, it either creates a DB and starts > adding names if the DB doesn't exist, or picks and displays a name if it does. > See the top of pick.rb, or run pick.rb --help for a full usage message. > > For all text-mode-only operations, names can be Unicode, but RMagick doesn't > seem to like that, so they can't be displayed nicely. Magick::ImageList.animate > is used for displaying, so it won't work for any name on Windows. > > I bracket chosen names in stars taken from: > > http://lonestarrubyconf.com/stylesheets/lsrc_2007/images/LSRC_big_title.jpg > > I'm not sure this list will accept messages containing graphics, so you'll > have to fetch this image and place it in the same directory as my code: > > http://www.jessemerriman.com/images/ruby_quiz/129_lsrc_name_picker/star_small.png > >