Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-auto_inject
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-container
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-matcher
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-monads
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-initializer
  • Feb 26 16:21
    karpinovsky starred dry-rb/dry-system
  • Feb 26 16:21
    karpinovsky starred dry-rb/dry-types
  • Feb 26 14:03
    solnic commented #143
  • Feb 26 13:19
    davydovanton commented #143
  • Feb 26 13:04
    solnic commented #143
  • Feb 25 23:58
    davydovanton review_requested #143
  • Feb 25 23:56
    davydovanton synchronize #143
  • Feb 25 23:56

    davydovanton on strategies-fail

    Fix error with mutation of froz… (compare)

  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton assigned #143
  • Feb 25 22:40
    davydovanton opened #143
  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton labeled #143
  • Feb 25 22:34

    davydovanton on strategies-fail

    Fix error with mutation of froz… (compare)

Piotr Solnica
@solnic
class Address < Dry::Data::Struct
  define do
    attr :city, "strict.string"
    attr :zipcode, "coercible.string"
  end
end
wdyt about this dsl ^ ??
:+1: or :-1: ?
Benjamin Klotz
@tak1n
why not attr on class level?
Luca Guidi
@jodosha
@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
@solnic I don't like that define block tbh
but I'll use it anyway =P
Piotr Solnica
@solnic
ended up with the same as virtus
Hannes Nevalainen
@kwando
:thumbsup:
Piotr Solnica
@solnic
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
I like the API virtus has, it "feels right"
Piotr Solnica
@solnic
ok ;)
the attribute options are horrible though, dry-data won’t have that
Hannes Nevalainen
@kwando
maybe horrible on the backside =P
Piotr Solnica
@solnic
I think it’s horrible on both sides
Hannes Nevalainen
@kwando
tbh I'm only using the :default option anyway =P
stupid markdown
Piotr Solnica
@solnic
btw I ported my app to dry-data for domain entities, so I guess I could push 0.0.1
@kwando ^
Hannes Nevalainen
@kwando
woho! =D
Piotr Solnica
@solnic
@kwando not sure how usable it’s gonna be for you, there’s a lot of rough edges wrt error handling
Piotr Solnica
@solnic
so I just pushed dry-data 0.0.1 to rubygems /cc @kwando
Luca Guidi
@jodosha
:clap:
Benjamin Klotz
@tak1n
:clap: :shipit:
Piotr Solnica
@solnic
lol ;)
Benjamin Klotz
@tak1n
:D
Piotr Solnica
@solnic
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
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
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
u didn't discourage me ;)
Piotr Solnica
@solnic
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
hehe so exactly what I need
Piotr Solnica
@solnic
we really really need a system that would allow us to define things like that
Benjamin Klotz
@tak1n
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
@tak1n there’s a lot of gotchas, that’s why isolating them is so important
Benjamin Klotz
@tak1n
true