Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 13 15:58
    rokhimin starred dry-rb/dry-matcher
  • Dec 13 08:53
    flash-gordon labeled #376
  • Dec 13 08:44
    solnic commented #376
  • Dec 12 21:34
    flash-gordon commented #376
  • Dec 12 21:34
    flash-gordon labeled #376
  • Dec 12 21:34
    flash-gordon opened #376
  • Dec 12 19:32
    RyanLafferty starred dry-rb/dry-types
  • Dec 12 05:53
    technofreak starred dry-rb/dry-monads
  • Dec 12 00:14
    thekuwayama starred dry-rb/dry-monads
  • Dec 11 09:29
    blasterun starred dry-rb/dry-monads
  • Dec 11 08:34
    flash-gordon closed #115
  • Dec 11 08:34
    flash-gordon commented #115
  • Dec 11 08:31

    flash-gordon on v1.3.3

    (compare)

  • Dec 11 08:30

    flash-gordon on master

    Bump version to 1.3.3 (compare)

  • Dec 11 08:30

    flash-gordon on master

    Update CHANGELOG (compare)

  • Dec 10 23:46
    johnmaxwell commented #116
  • Dec 10 21:54

    flash-gordon on master

    Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)

  • Dec 10 21:54
    flash-gordon closed #116
  • Dec 10 21:54
    flash-gordon commented #116
  • Dec 10 21:49
    johnmaxwell commented #116
Nick Sutterer
@apotonick
@timriley working a bit more with matcher, i think you're right about what you said earlier
Piotr Solnica
@solnic
Screen Shot 2016-11-03 at 17.09.00.png
@wafcio @jodosha we won RubyWeekly today ^^ :D
Ivo Benedito
@ivobenedito
hehe cool stuff there
Oskar Szrajer
@gotar
nice ;]
Nick Sutterer
@apotonick
great, get out the word!
Nick Sutterer
@apotonick
cool post, @solnic
Uros Jurglic
@jurglic
Hi guys! I'm new to dry-transaction gem, and I need an advice
Screen Shot 2016-11-04 at 13.22.26.png
^^ We have a transaction defined like this
Now the business requirement changed so that first three operations need to be run always - regardless of the result of the previous operation.
What would be the right way to approach in dry transaction?
Piotr Solnica
@solnic
@jurglic then it’s no longer a transaction :)
Uros Jurglic
@jurglic
Yeah, that crossed my mind too!
@solnic But if we forget that one for a minute... would something like that make more sense?
Screen Shot 2016-11-04 at 13.44.04.png
Piotr Solnica
@solnic
@jurglic it does
Uros Jurglic
@jurglic
Can the first three operations still use Either response? Or will it fail if one of them returns Left?
Nikita Shilnikov
@flash-gordon
@jurglic
Uros Jurglic
@jurglic
Is that so even if step is defined as map :qc_silence?
Thanks
Nikita Shilnikov
@flash-gordon
the only place where step adapter is used is here https://github.com/dry-rb/dry-transaction/blob/master/lib/dry/transaction/step.rb#L36 so your step have to return a Right instance always
Uros Jurglic
@jurglic
Sorry it's a bit confusing to me. So if I use map :qc_silence, the QcSilence should never return Left?
Nikita Shilnikov
@flash-gordon
no worries, well, map always returns Right so it should work just fine for you :) BUT there is a caveat
if you return Left/Right from QcSilence, map will wrap it once again
so you'll get Right(Right(...)) or Right(Left(...))
Uros Jurglic
@jurglic
Aha, I see.
Piotr Solnica
@solnic
according to docs, map always returns Right
Uros Jurglic
@jurglic
So you think my approach is somewhat acceptable? :D
@solnic Thanks Piotr yeah I saw that one, that's why I was confused before.
Piotr Solnica
@solnic
feels like an overhead though, if it always returns Right then maybe it’d be better to just pass plain values
Uros Jurglic
@jurglic
So the first 3 operations, - as implemented now - can return Left or Right. However they are independent. And now new requirement came they should run always no matter if any of them failed in a previous step.
So I'm trying to figure out what's the approach best aligned with dry-transaction.
Tim Riley
@timriley
Right now, it feels like it's be better just to run those three things in a custom class
@apotonick's pipetree stuff in trailblazer 2 makes me want to enrich some of the functionality of dry-transaction, but in a little while
Nick Sutterer
@apotonick
@timriley i was evaluating it
and decided to use my own pipetree stuff that is approved to work in representable, and is super fast
it's very important for that to be fast, since i want to use pipetree for all my gems and everything
we should probably "merge" those two gems
Nick Sutterer
@apotonick
@timriley question reg. dry-matcher. so, when i define using Matcher.new that's called the matcher object?
and when i evaluate it, how's that named?
and, what are you doing awake at 7am on a sunny saturday?
Tim Riley
@timriley
Kids :p
Yeah, I guess Matcher.new makes the matcher object, and then you run it with a a "match block" against some kind of value
/me will think about those names a little more
Steve
@dnd
is there a way to get the errors from dry-validation as symbols/keys instead of text sentences? I'm looking to get output like {amount: [:missing, :min_size]} or something like that
Nick Sutterer
@apotonick
@timriley "match block", i just called it handler, but yeah
Martín Fernández
@bilby91
Hello, do I need to require something in order to use Types::Maybe ?
Tim Riley
@timriley
Yeah, it's an "extension" now, @bilby91 - I'm on my phone right now but if you grep the specs for :maybe, you should see how it's done.