From: Chad Perrin Date: 2011-06-18T04:56:07+09:00 Subject: Re: default config file location --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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}" > >=20 > > Depending on the shell, '~' may not be defined. $HOME is a better > > choice generally. >=20 > 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. . . . --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk37rbwACgkQ9mn/Pj01uKWwCACgrRvw0lcxwMwWqMordDlwFbM1 IQ0AoNiSCjzJP2MBb148aihyXX/rfE1G =u1o3 -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--