These are chat archives for dry-rb/chat

5th
Oct 2015
Benjamin Klotz
@tak1n
Oct 05 2015 05:35
why not attr on class level?
Luca Guidi
@jodosha
Oct 05 2015 08:46
@solnic I have the same question, of @tak1n: why not at the class level (aka w/o define)? Is that because you want the block to be lazily eval'd?
Hannes Nevalainen
@kwando
Oct 05 2015 09:02
@solnic I don't like that define block tbh
but I'll use it anyway =P
Piotr Solnica
@solnic
Oct 05 2015 09:42
ended up with the same as virtus
Hannes Nevalainen
@kwando
Oct 05 2015 09:42
:thumbsup:
Piotr Solnica
@solnic
Oct 05 2015 09:42
the block gives you an opportunity to set some additional stuff common for all attr definitions, but that would be premature
so whatever ;)
Hannes Nevalainen
@kwando
Oct 05 2015 09:43
I like the API virtus has, it "feels right"
Piotr Solnica
@solnic
Oct 05 2015 09:43
ok ;)
the attribute options are horrible though, dry-data won’t have that
Hannes Nevalainen
@kwando
Oct 05 2015 09:45
maybe horrible on the backside =P
Piotr Solnica
@solnic
Oct 05 2015 09:46
I think it’s horrible on both sides
Hannes Nevalainen
@kwando
Oct 05 2015 09:48
tbh I'm only using the :default option anyway =P
stupid markdown
Piotr Solnica
@solnic
Oct 05 2015 10:32
btw I ported my app to dry-data for domain entities, so I guess I could push 0.0.1
@kwando ^
Hannes Nevalainen
@kwando
Oct 05 2015 11:20
woho! =D
Piotr Solnica
@solnic
Oct 05 2015 12:08
@kwando not sure how usable it’s gonna be for you, there’s a lot of rough edges wrt error handling
Piotr Solnica
@solnic
Oct 05 2015 12:59
so I just pushed dry-data 0.0.1 to rubygems /cc @kwando
Luca Guidi
@jodosha
Oct 05 2015 13:24
:clap:
Benjamin Klotz
@tak1n
Oct 05 2015 13:25
:clap: :shipit:
Piotr Solnica
@solnic
Oct 05 2015 13:25
lol ;)
Benjamin Klotz
@tak1n
Oct 05 2015 13:25
:D
Piotr Solnica
@solnic
Oct 05 2015 13:25
it’s an early alpha, I’m sure it’s gonna crash for you :joy:
otoh my app is working so that gives some level of confidence ;0
Benjamin Klotz
@tak1n
Oct 05 2015 13:25
hehe for sure :P
now Ill ask u twice as often
another lib from u I want to use :D
solnic QA team -> open position
Piotr Solnica
@solnic
Oct 05 2015 13:28
haha :)
I mean it’s a good start, so please try it out :) I didn’t mean to discourage you
I think the really tricky part will be APIs for defining types that are suitable for form-input
Benjamin Klotz
@tak1n
Oct 05 2015 13:29
u didn't discourage me ;)
Piotr Solnica
@solnic
Oct 05 2015 13:29
with nasty stuff like “something that can be an empty string, which then we want to turn into nil unless it’s a string parsable to a date"
Benjamin Klotz
@tak1n
Oct 05 2015 13:29
hehe so exactly what I need
Piotr Solnica
@solnic
Oct 05 2015 13:29
we really really need a system that would allow us to define things like that
Benjamin Klotz
@tak1n
Oct 05 2015 13:31
empty string -> date?
ah fuck "".to_i is zero
this to Date is a valid Date
:D
FUN
irb(main):009:0> Date.new("".to_i)
=> #<Date: 0000-01-01 ((1721058j,0s,0n),+0s,2299161j)>
irb(main):010:0> Date.new("")
ArgumentError: comparison of String with 0 failed
        from (irb):10:in `<'
        from (irb):10:in `new'
        from (irb):10
        from /usr/bin/irb:11:in `<main>'
why ruby why..
Piotr Solnica
@solnic
Oct 05 2015 13:35
@tak1n there’s a lot of gotchas, that’s why isolating them is so important
Benjamin Klotz
@tak1n
Oct 05 2015 13:35
true