TIL Types::Hash.map is still not fully supported by dry-schema/dry-validations. :(
https://github.com/dry-rb/dry-types/commit/04c66608f9d2e4b9e6aacb14e492ea9c13caea4a
#dry_rb #dry_types
Solved: use `Types::Symbol.enum(symbol: 'string', ...)` if you want to convert Strings into Symbols.
#dry_rb #dry_types
Clever. dry-validations allows for rules to execute on each value in an Array using `rule(:name).each do ...`.
https://dry-rb.org/gems/dry-validation/1.5/rules/
#dry_rb #dry_validations
Now that I'm writing HTML forms to pass params to dry-validations/dry-schema, I'm wondering if anyone has built a form builder library that can interpret dry-types and generate the appropriate form fields? Or is that what trailblazer is for?
#dry_rb
How do you specify the key and value types of a Hash using dry-schema?
#dry_rb
and here's the end-result of all of my dry-rb questions and complaining about docker/docker-compose. A small Sinatra app which uses dry-schema/dry-validations to validate/coerce form input, pass it to a Sidekiq worker, and coerce the JSON params back into a Symbol Hash, which is then **kwargs splatted to another library.
https://github.com/ronin-rb/ronin-app
#dry_rb #sinatra #sidekiq
Once you've defined your Dry::Types, Dry::Schemas, and Dry::Validations, do you typically also write tests to double check that they work as intended? Or do you trust the declarative nature of the dry-* libraries?
#dry_rb
I'm planning (🤞) to start publishing again. Maybe this time it'll work - so here's a question: what would you be interested in seeing the most?
#ruby #hanami #dry_rb #programming #blog #screencasts #poll
@solnic hi Peter, welcome back!
I'm glad you had time to recharge and get some rest, and please don't hesitate to take more, we (the community) are OK, the #hamani & #dry_rb can always wait because you, the person, is always more important than any work project that happen to depend in them and your leadership and tremendous knowledge and passion.
Thanks, and welcome back, again.
I released dry-matcher 1.0.0 today. It's something we built years ago and I remember that this was yet another "weird concept" we were bringing to #Ruby 🙀
Eventually, Pattern Matching was introduced as one of the new language features and now more and more people are adopting it 🤓
Seeing functional concepts becoming part of Ruby makes me very happy. I hope all the naysayers have changed their mind already! 😊
#ruby #dry_rb #patternmatching
"Benchmarking Ruby 3.2 with YJIT"
https://www.solnic.dev/p/benchmarking-ruby-32-with-yjit
#ruby #rubynews #hanami #dry_rb #benchmark #opensource #programming #opensource
#ruby #rubynews #hanami #dry_rb #benchmark #opensource #programming
📣 dry-schema 1.13.0 was just released which ships with upgraded dry-logic to 1.5.0 - it fixes compatibility with `eql?` and `respond_to?` predicates which previously were conflicting with the default implementation in Object.
See full changelog 👇
https://github.com/dry-rb/dry-schema/releases/tag/v1.13.0
#ruby #dry_rb #rubygem #validation #oss #opensource #library
#ruby #dry_rb #rubygem #validation #oss #opensource #library