Subject: | Use File::HomeDir's my_home() instead of my_data() to find config file |
From dbi-dev mailing list:
---snip---
Show quoted text
> The docs for Test::Database tell me to write ~/.test-database, which I
> did, but running tumbler complains about a missing init file at
> /home/merijn/.local/share/.test-database
I've never been a fan of File::HomeDir, which Test::Database uses.
I added that log message saying what path it was reading in order
to work out what the heck it was doing. For me, on a mac, it's
using /Users/timbo/Library/Application Support/.test-database' :(
I see Test::Database is using the my_data() method which the
File::HomeDir docs describe as "data that supports an application but
*isn't normally editing* by the user directory should go into my_data."
(Emphasis mine.) So use of my_data() is unfortunate. Using my_home()
would be more natural for more users.
---snip---
I suggest using my_home() to locate the config file (with a fallback to trying my_data() for backcompat if a file isn't found).
That'll avoid the docs either lying on many systems, or having to be updated to match and describe all the places that my_data() might refer to on various systems.