From: Chad Perrin Date: 2011-06-18T10:49:57+09:00 Subject: Re: default config file location --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 18, 2011 at 07:29:58AM +0900, David Masover wrote: > On Friday, June 17, 2011 02:53:23 PM Chad Perrin wrote: > > On Sat, Jun 18, 2011 at 04:45:56AM +0900, Matthew K. Williams wrote: > > > On Sat, 18 Jun 2011, Chad Perrin wrote: > > > >Is there a "better" way to specify a default config file location th= an > > > >this? > > > > > > > > File.expand_path('~') + "/#{filename}" > > >=20 > > > Depending on the shell, '~' may not be defined. $HOME is a better > > > choice generally. > >=20 > > I take it you mean the above should be changed to this: > >=20 > > ENV['HOME'] + "/#{filename}" > >=20 > > Is that what you mean? >=20 > As people have pointed out, File.expand_path probably works. Yeah -- I started composing this before the other emails started showing up in my inbox. > > I do find this a bit cleaner, though: >=20 > File.join(ENV['HOME'], filename) As do I, now that I've had time to think about it. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk38ALAACgkQ9mn/Pj01uKWCZgCeLb6JqlEkEdQlhbowPOHXxGkY JrsAnRggAdenTVYdjb7dBMMC17XKGZDe =D8zv -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz--