Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 05 17:01
    emaraschio starred dry-rb/dry-monitor
  • Apr 04 15:38
    nepalez closed #74
  • Apr 04 15:38
    nepalez commented #74
  • Apr 04 10:40
    qortex commented #400
  • Apr 04 08:47
    flash-gordon closed #400
  • Apr 04 08:47
    flash-gordon commented #400
  • Apr 03 21:18
    qortex starred dry-rb/dry-types
  • Apr 03 21:14
    qortex edited #400
  • Apr 03 21:14
    qortex labeled #400
  • Apr 03 21:14
    qortex opened #400
  • Apr 03 19:18
    landongrindheim commented #74
  • Apr 02 19:47
    kamilski81 starred dry-rb/dry-monads
  • Apr 02 17:26
    waleedasif322 starred dry-rb/dry-types
  • Apr 02 14:59
    sskylar starred dry-rb/dry-monads
  • Apr 02 13:51
    kirin121 starred dry-rb/dry-container
  • Apr 02 10:56

    davydovanton on performance-improvements-for-rack-monitorring

    (compare)

  • Apr 02 10:55

    davydovanton on master

    Improve memory allocation for R… Merge pull request #34 from dry… (compare)

  • Apr 02 10:55
    davydovanton closed #34
  • Apr 02 02:25
    DaiAoki starred dry-rb/dry-types
  • Apr 01 14:39
    davydovanton commented #34
Daniel Gollahon
@dgollahon
that's actually exactly what i was asking about
Piotr Solnica
@solnic
if you have more you can do this too:
Dry::Validation.Schema(Dry::Validation::Schema, rules: SomeSchema.class.rules + OtherSchema.class.rules)
so as you can see, it’s awful :laughing:
Daniel Gollahon
@dgollahon
haha
Piotr Solnica
@solnic
there’s an issue about it
Daniel Gollahon
@dgollahon
that last one is a little awkward, yeah
Piotr Solnica
@solnic
well, it’s just not done yet (hence no docs too)
Daniel Gollahon
@dgollahon
but the first case seems potentially useful. i'll have to tinker with it.
yeah
totally understand
Piotr Solnica
@solnic
this is tricky stuff so it’s taking some time
Daniel Gollahon
@dgollahon
yeah, definitely
Piotr Solnica
@solnic
schemas have all sorts of properties, so it’s not just “use inheritance Luke!”
Daniel Gollahon
@dgollahon
but good to know there's an effort about it.
haha, yeah.
Piotr Solnica
@solnic
well, we just need to come up with an API :)
because internals are ready
Daniel Gollahon
@dgollahon
and "use inheritance Luke!" is also not inherently simple.
cool
Piotr Solnica
@solnic
that too :)
schema rules is just an array with rules, so we can append stuff, prepend stuff, compose with others, whatever we want
and since input processors are decoupled, this doesn’t affect the rules at all
furthermore, message compilation is decoupled too, so we can easily tune message settings for a schema that inherits rules from multiple other schemas that have different message settings :)
Daniel Gollahon
@dgollahon
neat, seems great. just time to do some API pondering.
seems like some of the harder parts will be if you have collisions
where both schema A and B operate on key foo.
Piotr Solnica
@solnic
we can do stuff like [a_rules.select { |r| r.name == :foo } + b_rules.select { |r| r.name == :foo }].reduce(:and)
errrr s/select/detect/
this stuff is crazy flexible so we can either do this, or make it configurable, or raise an error, dunno :)
Daniel Gollahon
@dgollahon
yeah. i would expect you could inadvertently get contradictory rules with an and. but maybe that's just your fault and ohwell :P
might be less surprising to raise an error. but i don't know, there may be a reasonable alternative.
Juanma Cervera
@jmcervera
Hi, A question about testing.
I'm developing a dry-system project, where my functional classes are registered in the app container.
I instantiate the objects in specs through the container as I do in the app.
How should I instantiate the subject object when I want to mock some of the dependencies,
with mocks or lambda functions to avoid for example go to the database through a repository?
Should I instantiate the object with new and not use the DI?
Is there a way to mock only some of the dependencies and get DI work for the others?
just use .new + kwargs (it’s the default constructor type in autoinject)
Juanma Cervera
@jmcervera
@solnic Thanks :smile:
Sergey Novikov
@droptheplot
Hi there! Looks like a have a similar questions but don't know where to start. I'm using containers in my application and currently calling them like container['somenamespace.somecontainer'].call within my specs. The questions is how to use auto_inject inside specs?
Jānis Miezītis
@janjiss
Hey folks, I created a gem main purpose of which is to map data from unformated hash (In my case from CSV rows) and turn it to some usable domain objects and to add dry-types as a basis for type checks. https://github.com/janjiss/massager
Piotr Solnica
@solnic
@janjiss oh cool I’ll check it out. thanks for sharing
Jānis Miezītis
@janjiss
@solnic On which time zone are you? Are you in Krakow or in US atm?
Just curiosity - Since your work hours look more like US, but under profile there is Krakow :D
Piotr Solnica
@solnic
@janjiss US atm
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic Is it allowed to have multiple predicates( My::Predicates ) statements in the config block auf a schema?
Piotr Solnica
@solnic
@cdennl it’s config.predicates = YourPredicates since 0.9.x
or 0.8.0 O_o can’t remember exactly
oh and no, it doesn’t support more than one predicate module, at least not yet
Christopher Dennl-Ortega Arrieta
@cdennl
it is predicates(...) in 0.9+ :) and thank you I saw that only one is working at the moment
Piotr Solnica
@solnic
Ah right, I kept it eventually. Sorry, too much on my mind :)
Michał Gutowski
@CucumisSativus
Hey guys, in dry-types is there built-in way to make your own type to behave like a Maybe type?
Nikita Shilnikov
@flash-gordon
@CucumisSativus wdym by saying "behave like"?