From: "Matthew K. Williams" Date: 2011-06-18T05:09:02+09:00 Subject: Re: default config file location On Sat, 18 Jun 2011, Chad Perrin wrote: > On Sat, Jun 18, 2011 at 04:49:24AM +0900, 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. :-) > > Do you know whether that's consistent across Ruby implementations (e.g, > Rubinius and JRuby)? I imagine it is for Rubinius, at least, given the > project's focus on API consistency. . . . It works on jruby (I checked 1.6.0) Matt