-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow local env files for each Rails environment, and host family. Fix dotenv file load order and overriding values. #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great change to me! Thanks for fixing the specs in addition to making things a bit more predictable.
This change is technically breaking, so I'd probably recommend a major version bump. We can definitely do that in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks so much! I think we'll need to ping @wireframe to do the actual publish of the gem once this is merged.
this is amazing @cfurrow! Thank you for your contribution! I'll merge and push an updated release shortly! |
version 0.2.0 has been published to rubygems! |
Woohoo! Thanks for merging so fast, @wireframe ! |
Suggesting this change to be a major bump in version as it changes the underlying behavior.
The Problem
While doing some local testing with VCR, I realized my
.env.local
was superseding values set in.env.test
. I did not want this..env.local
is NOT committed to the repository, and therefore is local to my machine.env.test
IS committed to the repository, and shared by all devs + our CI environment.My VCR tests were using MY local credentials in
.env.local
, which is not what I wanted it to do. The specs I was writing could/would fail in CI, as the credentials and VCR request matchers would be in conflict.The solution
Allow for more fine-grained .env filenames, and make sure the test environment does not use my
.env.local
, but instead would rely on.env
,.env.test
,.env.HOST_FAMILY
,.env.test.local
and.env.HOST_FAMILY.local
. Then I could rename my.env.local
to.env.development.local
and keep it out of the repo, and out of the test environment.Added rspec tests
I noticed there was a spec directory, but no valid specs. And
rspec
was not a dependency of the gemspec, so I added it, plusrails
, in order to get the rspec tests passing and validated.