I’m thinking of adding the dotenv gem (https://github.com/bkeepers/dotenv) to my plugin for testing and development purposes. This is so that I can easily set my environment variables per environment.
I was wondering if I’m missing something and there’s a better way of achieving this?
Unfortunately not. I’m working on a private plugin and need to set an environment variable for sensitive data so that I’m not checking it into source control.
It’s fine setting that environment variable on the production server, but I want to be able to load this into the test environment when running tests for example. I could specify it inline, but ideally I’d want a more scalable solution.
The reason I posted is because adding that gem feels wrong, I would have assumed that Discourse would already have a solution for this problem.