From: Joel VanderWerf Date: 2008-10-09T02:42:28+09:00 Subject: Re: Suggestions for common/global data in app (cli) Nit Khair wrote: > I am writing a (my first) client side ruby app. Many programs use the > same data such as db login, logger etc. Is there a standard ruby way of > doing this? Some suggestions would be useful. > > - I have used YAML for config data for single scripts earlier > - I am aware of 'load'ing a ruby file which could have config data in > it. > - A module with global constants > > Would these files (yaml, load) have to loaded in each program? > > Have I missed any approach? I have heard of global vars but never used. > > I would appreciate a link to any ruby application best practices, too. > Thanks. One suggestion (based on yaml): http://redshift.sourceforge.net/preferences/ It also provides a utility method to find the right user dir to store prefs in, based on env vars. It may be overkill for a simple program though. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407