I decided to do a little Ruby coding on preferences/config files for
Shoes scripts. It's far from perfect but its a reasonable start. It
works for me on Ubuntu Linux 8.04. The Windows and OS X parts aren't
coded (your help is solicited - can't be that hard if you know where the
files should go)

The gziped tar ball is at http://mvmanila.com/public/Prefs.tar.gz. It
expands to one directory 'Prefs' with 4 files in there. Prefs.kpf you
can delete, its from my IDE thingy. 'preferences.rb' is the file you
'require'. 'prefstest.rb' is a command line exerciser. 'ShoesPrefs.rb'
is a Shoes gui example that works for me. 

It's far from the best code on the planet. It's a placeholder, a
strawman, just a little hack others can build on or dissect or replace
and then _why can put the result of our deep thoughts in a properly
fitting pair of Shoes. Change the names, the code, laugh at me or whine.
I'm not in love with it that code. Someone has to go first. 

For Shoes apps, you'll probably want to subclass Preferences and add
your own load() because that's how you can set up defaults when there is
no preferences file (first run). Over ride initialize (see prefstest.rb)
if you want additional directories created. Linux users can look in
their '~/.gnome2/' to see why that capability is there if you need it.

--Cecil



Reply via email to