-
Notifications
You must be signed in to change notification settings - Fork 23
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 exhaustive case matcher #43
Add exhaustive case matcher #43
Conversation
@dblock here you go :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close! I left a bunch of comments/questions, take a look.
Thanks a lot for the deep review and your comments! I appreciate it :) |
Make rubocop happy and we're good to go! Much thanks. |
Oh and since it's a new feature, increment the version to 0.10.0 in this PR. I also wonder whether it's time for Ruby::Enum to graduate to 1.0. That works for me too, your call! |
Rubocop is failing on master. Hence, I will make the Rubocop adjustments in a separate commit. |
Can be used by including `Ruby::Enum::Ecase` in an enum class. It will add a method called `ecase` that can be used to simulate a case statement that will raise an error if a case/enum value is not handled.
I had to disable and ignore some Rubocop rules. See the Rubocop related commit. I wanted to make as little changes as possible in that commit. |
I feel like it's a good idea to release a 1.0.0 version as it has been proven stable. Note: the 0.9.1 version has not been tagged or released to Ruby gems yet. |
But maybe it makes sense to wait for #41 for the 1.0.0 release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Rubocop, you can remove any of the manual disable and the new rules and just run rubocop -a ; rubocop --auto-gen-config
, but what you have here works fine too.
Are you going to take it up? :) Please! |
I might give it a try next week. |
Great work @peterfication! Want to help comantain ruby-enum? Drop me your rubygems username to dblock at dblock dot org! |
Can be used by including
Ruby::Enum::Ecase
in an enum class. It will add a method calledecase
that can be used to simulate a case statement that will raise an error if a case/enum value is not handled.Fixes #42