These are chat archives for dry-rb/chat

18th
Jul 2016
Kiril Dokh
@dsounded
Jul 18 2016 07:23
@solnic Have you taken a look at pastebin I sent ?
Piotr Solnica
@solnic
Jul 18 2016 08:08
@dsounded yes, and I wrote:

@solnic
@dsounded damn, seems like this is still not gonna work in your use-case. I forgot to add support for this to high-level rules ;(
I’ll do that in 0.9.3 or 0.10.0

:/

Kiril Dokh
@dsounded
Jul 18 2016 08:31
@solnic Thanks, could you give a ballpark date ?
Piotr Solnica
@solnic
Jul 18 2016 09:37
@dsounded hard to say, I’m in rom-rb mode this month, very little time for dry-rb stuff but hopefuly later this month
Kiril Dokh
@dsounded
Jul 18 2016 09:43
Hmm, maybe I could help with this ?
henricus louwhoff
@hl
Jul 18 2016 13:30

@hl I'm not sure what you mean by "parser" here, but we do plan to write a server-side Ruby-based form renderer before we get to 1.0

@timriley Yes I meant renderer, thanks!

henricus louwhoff
@hl
Jul 18 2016 13:44
dry-guys thank you, I did not understand how stuck I was in my Railsway until I used some of the dry gems
Rafael George
@cored
Jul 18 2016 13:55
@hl are you building something from scratch or are you refactoring an existing Rails app?
@timriley sorry, I went away to Go conf the other day and was out of sight. I'm guessing that for my example I need to use the skeleton with dry-web, right?
henricus louwhoff
@hl
Jul 18 2016 14:02
@cored I threw away my Rails app and started from scratch
Rafael George
@cored
Jul 18 2016 17:01
@hl oh, interesting
Kevin Ross
@rosskevin
Jul 18 2016 20:00
looking at using dry-validation with our trailblazer operations. in the name of reuse, interested in serializing the schemas as json or writing a serializer directly that generates a yup schema (which looks very similar): https://github.com/jquense/yup
An thoughts or pointers on accomplishing that?
Piotr Solnica
@solnic
Jul 18 2016 20:36
irb(main):001:0> Dry::Validation.Schema(build: false) { required(:name).filled(:str?); required(:age).maybe(:int?) }.rule_ast
=> [[:and, [[:val, [:predicate, [:key?, [[:name, :name], [:input, undefined]]]]], [:and, [[:key, [:name, [:predicate, [:filled?, [[:input, undefined]]]]]], [:key, [:name, [:predicate, [:str?, [[:input, undefined]]]]]]]]]], [:and, [[:val, [:predicate, [:key?, [[:name, :age], [:input, undefined]]]]], [:or, [[:key, [:age, [:predicate, [:none?, [[:input, undefined]]]]]], [:key, [:age, [:predicate, [:int?, [[:input, undefined]]]]]]]]]]]
@rosskevin just use this ast and write a compiler that will convert it to yup format ^
Kevin Ross
@rosskevin
Jul 18 2016 20:37
thanks, I think that will work