These are chat archives for dry-rb/chat

5th
Sep 2017
Chris Richards
@cmrichards
Sep 05 2017 13:35
I was hoping that the match block (m.success do .. end) functionality would work with dry-monads, but no luck.
Nikita Shilnikov
@flash-gordon
Sep 05 2017 13:36
@cmrichards wdym?
there is dry-matcher for this
Chris Richards
@cmrichards
Sep 05 2017 13:36
ahhh
thanks
i'll check that out
Nikita Shilnikov
@flash-gordon
Sep 05 2017 13:36
:+1:
Chris Richards
@cmrichards
Sep 05 2017 13:37
I was hoping to return a monad from a plain PORO service object
Right/Left monad
Nikita Shilnikov
@flash-gordon
Sep 05 2017 13:38
@cmrichards you'll need to add include Dry::Matcher.for(:call, with: Dry::Matcher::EitherMatcher) to your class
Chris Richards
@cmrichards
Sep 05 2017 13:41
thanks. that's just what i needed
Now i need to figure out if this is a good idea for simple service objects
Guilherme Moreira
@gmmoreira
Sep 05 2017 17:03
Hello everyone
Is it possible in dry-system to auto-register some paths without 'require' the components? I just want them to be registered
I have a rails app and I want all components under app/services to be registered, but Rails itself already require all files under that directory. When dry-system auto-register them, it require the same file again
Chris Richards
@cmrichards
Sep 05 2017 17:09
sounds like you want to exclude the folder from Rails's autload paths
I'm not sure if it's possible to exclude a folder if the parent has been added to config.autoload_paths
Guilherme Moreira
@gmmoreira
Sep 05 2017 17:12
I believe you can only append new paths
everything under app is already autoload by default
Guilherme Moreira
@gmmoreira
Sep 05 2017 17:48
I do not require them to be registered anyway