From: Jeremy Bopp Date: 2011-06-18T04:49:24+09:00 Subject: Re: default config file location 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. :-) I might simplify this just a tiny bit though: File.expand_path("~/#{filename}") -Jeremy