palkan / anyway_config

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

Set fallback for empty YAML config file #83

Closed micahlee closed 3 years ago

micahlee commented 3 years ago

What is the purpose of this pull request?

This PR addresses a bug when attempting to load an empty config file (or a file that is all comments). Currently, this results in an error:

undefined method `key?' for false:FalseClass

I didn't first file a bug issue for this, but I can if you prefer.

Thanks!!

What changes did you make? (overview)

By default, loading an empty YAML file returns the value false. For an empty config file, we instead want to return an empty hash ({}).

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

Checklist