dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

Add predicates for checking V1, V2, V3, V5 UUIDs. #75

Closed jamesbrauman closed 4 years ago

jamesbrauman commented 4 years ago

I have a need to validate other versions of UUIDs than just V4. Because the uuid_v4? predicate exists, can we also add predicates for other UUID versions?

Should I also add a uuid? predicate that checks for V1-V5 UUIDs?

Reference: https://stackoverflow.com/a/38191104

dry-bot commented 4 years ago

Codacy Here is an overview of what got changed by this pull request:


Issues
======
- Added 44

Clones added
============
- spec/unit/predicates/uuid_v3_spec.rb  1
- spec/unit/predicates/uuid_v1_spec.rb  1
- spec/unit/predicates/uuid_v5_spec.rb  1
- spec/unit/predicates/uuid_v2_spec.rb  1

See the complete overview on Codacy

solnic commented 4 years ago

@jamesbrauman thank you James, you can now enjoy your new predicates in the freshly released dry-logic 1.0.7 😄

jamesbrauman commented 4 years ago

@solnic Thank-you for responsiveness, and the dry-rb suite of gems!