palkan / anyway_config

Configuration library for Ruby gems and applications
MIT License
778 stars 52 forks source link

Add type coercion #85

Closed palkan closed 3 years ago

palkan commented 3 years ago

What is the purpose of this pull request?

Add ability to specify config parameters types. One of the main reasons is to give more control on how values are type casted.

Closes #75. Closes #82.

What changes did you make? (overview)

Is there anything you'd like reviewers to focus on?

The current implementation moves type casting from env to config, thus, changing the way we treat non-ENV sources: now all values set during the load phase are type-casted. That could potentially lead to breaking changes in case a string auto-casted as array would occur.

Checklist