From: Piotr Szotkowski Date: 2011-06-19T05:26:18+09:00 Subject: Re: default config file location --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Chad Perrin: > Is there a "better" way to specify > a default config file location than this? > File.expand_path('~') + "/#{filename}" Depending on how =E2=80=98good=E2=80=99 you want to be with regards to modern systems adhering to the FreeDesktop standard=C2=B9. :) The last time I needed to take care of this (YAML =E2=80=98database=E2=80=99 with signatures for signore, a signature randomiser) I settled on (ENV['XDG_DATA_HOME'] or File.expand_path '~/.local/share') + '/signore/sig= natures.yml' =E2=80=93 so for a config file I=E2=80=99d go with (ENV['XDG_CONFIG_HOME'] or File.expand_path '~/.config') + "/#{appname}/#{c= onfigfilename}" =C2=B9 http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.ht= ml =E2=80=94 Piotr Szotkowski --=20 We tried that One Encoding To Rule Them All in Java, and it was a failure. We tried it again with a different encoding in Java 5, and it was a failure. We tried it in .NET, and it was a failure. The Python community is currently in the process of realizing it was a failure. Five years of work on PHP 6 were completely destroyed because of this. (At least they realized it *before* releasing it into the wild.) [J=C3=B6rg W Mittag, ruby-= talk] --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk39Cd0ACgkQi/mCfdEo8UqdIQCgzAnvweD/y9M03LZ6pW+SAE+7 x5gAoMsjejrZDMl+HAAEd1XkcnE2GSNT =wS1Z -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G--