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
Add required_keys!(...) method to Env #75
Conversation
@laserlemon StringInquirer is being used in the application_spec. This is my super cheap fix so I could start with green tests.... master was red. I'm not sure how you want to fix the failing test; likely the simplest fix is to include the StringInquirer in the spec. |
Yeah, I'd recommend putting that |
@laserlemon I've fixed up the broken spec on #76 ; I've rebased this one off the fixed spec_helper. |
@laserlemon I'm liking a lot of the work done on master. When are we going to see it all in a release? And could this feature make it in? |
@mulder Thanks! Yes, master is shaping up but I've been so swamped with work work that it hasn't moved in a little bit. I like this idea quite a bit and I think it should be included in the next release. I may decide to change the naming to be a little more verb-y like |
Moving it up to Figaro namespace makes sense to me. I put on env because that is where all the env key/var magic was. I'm not fussy on the name, nor the location, but if the purpose is raising an error I'd like to see the ! stay. I'm up for pitching in on this project if you need a hand with other features/refactors. |
Tests run just fine in here without 2097116 . |
not for me using |
This allows you to do an aggressive post launch test to confirm all the keys your apps need are present and ready to go. It will raise an exception if any are missing and it will tell you which of the required keys are missing. Use this in rake tasks so cap can bail mid deploy, or in production.rb to stop server boots.
And there is the problem; bundle exec does a much better job. I've rebased away the bad. |
@laserlemon is there something still holding this or could we get it merged? |
This PR won't be merged in as-is but the idea is great. I'm of the opinion that you shouldn't write a bang method if there's no non-bang counterpart. I think the winner is In the case where values for provided keys are not set, an error will be raised with messaging that includes every key that's missing. I'll see what we can do for release with version 1.0. Thank you! |
Allows you to do an aggressive post launch test to confirm all the
keys your apps need are present and ready to go.
It will raise an exception if any are missing and it will tell you
which of the required keys are missing.
Use this in rake tasks so cap can bail mid deploy, or in production.rb
to stop server boots.