From: Josh Cheek Date: 2010-04-08T11:45:18+09:00 Subject: Re: Best practice for saving settings in separate file --000e0cd1383ee13f280483b0a98b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Apr 7, 2010 at 8:20 PM, Oyvind Pettersen wrote: > I'm currently building an application that relies on a rather large set > of settings and paths that needs to sit in its own file. > > What are the best way to go about? XML? Simple strings in a text file? > > The settings files would be created manually, but the app will have to > update a few integers in the files. > > Thanks in advance, > > =D8yvind > -- > Posted via http://www.ruby-forum.com/. > > I think the book Ruby in Practice has a section on this (I left it at work, so I can't check for you, sorry). I was looking at Configliere the other day, and it looks pretty cool, http://github.com/mrflip/configliere It looks like you can use it to take the place of optparse too (at least thats how I interpreted it). You might also check out http://github.com/binarylogic/settingslogic which is by binarylogic, the author of AuthLogic (a rather popular authentication gem for Rails). Looking through the tests and source, though, it doesn't appear to have a way to save the settings back to the file. It uses Yaml, like Intransition suggested. But it's only about 150 lines, you could alway= s scratch that itch. --000e0cd1383ee13f280483b0a98b--