Add docs for hexdocs
It would be useful to groom through the module and function docs so hexdocs can be as useful a reference (if not more) than the Github README.
@fireproofsocks that would be great! Want to submit a PR?
I started combing through things and adding ## Examples blocks -- see PR #40 (comments welcome).
However, I have a couple questions:
I'm confused by the Dotenv.load!/1 vs Dotenv.load/1 -- usually I would expect a function ending with ! to raise on error, and the other to wrap its result in a tuple, but both variants do not handle errors, e.g.
iex(5)> Dotenv.load("asdfas")
** (File.Error) could not read file "asdfas": no such file or directory
(elixir 1.11.1) lib/file.ex:354: File.read!/1
(dotenv 3.1.0) lib/dotenv.ex:241: Dotenv.read_env_file/1
(dotenv 3.1.0) lib/dotenv.ex:158: Dotenv.load/1
iex(5)> Dotenv.load!("asdfas")
** (File.Error) could not read file "asdfas": no such file or directory
(elixir 1.11.1) lib/file.ex:354: File.read!/1
(dotenv 3.1.0) lib/dotenv.ex:241: Dotenv.read_env_file/1
(dotenv 3.1.0) lib/dotenv.ex:158: Dotenv.load/1
(dotenv 3.1.0) lib/dotenv.ex:135: Dotenv.load!/1
The Dotenv.Env.get/3 function seems to have arguments swapped from what I would expect from the likes of Map.get/3 -- I would expect the default (i.e. "fallback") value to be the 3rd argument, not the 2nd. This seems a mashing of Map.get/3 and Map.get_lazy/3, no?
Would you be open to discussing the organization and approach of this package? I think it could be adjusted to support releases and help simplify the Mix configs.
Would you be open to discussing the organization and approach of this package? I think it could be adjusted to support releases and help simplify the Mix configs.
Yes, definitely! Submit a PR and I'll take a look. There are definitely lots of improvements to be made last time I took a look.