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

Auto type env var injector #13

Merged
merged 6 commits into from
Nov 18, 2015

Conversation

workanator
Copy link
Contributor

Hello,
I added the auto type resolution env var injector. It tries to match the type of the underlying value using existing parsers.

Example:

export MY_VAR1=True;
export MY_VAR2=42;
some_auto_var1 = $"MY_VAR1"; // The result type is ScalarValue::Boolean(true)
some_auto_var2 = $"MY_VAR2"::auto; // The result type is ScalarValue::Integer32(42)

} else {
ScalarValue::Str(value)
}
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add at least a TODO here to handle the error case. Arguably, the library needs a refactor to generate proper errors, and I intend to do that soon, so please make life easier for me and add a note here.

Please follow this format:

// TODO(your_username) TODO-description-here

Or if you want to leave it up to me, you can use // TODO(filipegoncalves). See the example TODO line I added on your other PR where you did something similar.

@filipegoncalves
Copy link
Owner

Closing / reopening to force travis rebuild (library was updated to use nom 1.0)

filipegoncalves added a commit that referenced this pull request Nov 18, 2015
Auto type env var injector
@filipegoncalves filipegoncalves merged commit 0d0de33 into filipegoncalves:master Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants