Skip to content
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

Should blank values be considered as "set"? #122

Open
laserlemon opened this issue Apr 17, 2014 · 2 comments
Open

Should blank values be considered as "set"? #122

laserlemon opened this issue Apr 17, 2014 · 2 comments
Labels
Milestone

Comments

@laserlemon
Copy link
Owner

If the value for a given ENV key is set to "", should that value be considered as being set?

ENV["foo"] = ""

Figaro.env.foo? # => true or false
Figaro.env.foo! # => "", nil or Figaro::MissingKey
Figaro.env.foo # => "" or nil

The current behavior is (and always has been) that a blank string is a valid value and counts as having been intentionally set to that value.

@laserlemon laserlemon added this to the v1.1 milestone Apr 17, 2014
@sheerun
Copy link

sheerun commented Aug 9, 2014

I think there's no single use case when empty string is useful input.

I'd go with pragmatic approach and treat ? methods just as blank? in rails.

@glennfu
Copy link

glennfu commented Sep 24, 2014

To keep my code clean I'm wanting to use Figaro.env.feature_enabled? to decide whether or not a feature should be used in a particular environment. That seems to be the nicest way to use it. However if it's set to "true" somewhere, and I want to quickly override it by doing heroku config:set feature_enabled=#### I can't find anything to set it to to make that flip to false and quickly disable the feature. This would at least give me an option to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants