From: "Matthew K. Williams" Date: 2011-06-18T04:54:26+09:00 Subject: Re: default config file location On Sat, 18 Jun 2011, Jeremy Bopp wrote: > On 6/17/2011 14:45, Matthew K. Williams wrote: >> On Sat, 18 Jun 2011, Chad Perrin wrote: >> >>> Is there a "better" way to specify a default config file location than >>> this? >>> >>> File.expand_path('~') + "/#{filename}" >> >> Depending on the shell, '~' may not be defined. $HOME is a better >> choice generally. > > According to the documentation for File.expand_path, all that is > required is that $HOME is set correctly. It doesn't apparently use the > shell to figure this out. Chad's method even works on Windows. :-) > Thanks for that; I'll have to remember it! Matt