Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 20 19:40
    lancecarlson starred dry-rb/dry-monads
  • Nov 20 15:22
    scaint starred dry-rb/dry-monads
  • Nov 20 11:05
    FunkyloverOne starred dry-rb/dry-monads
  • Nov 20 06:22
    zlei1 starred dry-rb/dry-web
  • Nov 18 00:58
    dteoh starred dry-rb/dry-types
  • Nov 17 21:02
    flash-gordon commented #374
  • Nov 17 21:01

    flash-gordon on master

    Update custom_ci.yml Merge pull request #374 from sk… (compare)

  • Nov 17 21:01
    flash-gordon closed #374
  • Nov 17 20:59
    skryukov opened #374
  • Nov 17 16:42

    flash-gordon on use-immutable-equalizer

    (compare)

  • Nov 17 16:42

    flash-gordon on master

    Use immutable equalizer for all… Merge pull request #373 from dr… (compare)

  • Nov 17 16:42
    flash-gordon closed #373
  • Nov 17 16:38
    flash-gordon opened #373
  • Nov 17 16:38

    flash-gordon on use-immutable-equalizer

    Use immutable equalizer for all… (compare)

  • Nov 17 16:34

    flash-gordon on no-rewrap-for-structs

    (compare)

  • Nov 17 16:34

    flash-gordon on master

    Don't build constructors when c… Merge pull request #371 from dr… (compare)

  • Nov 17 16:34
    flash-gordon closed #371
  • Nov 16 11:28
    marekciupak starred dry-rb/dry-monads
  • Nov 16 07:48
    luizfonseca starred dry-rb/dry-view
Piotr Solnica
@solnic
(oh and I should mention I am a huge RSpec fan)
Eliav Lavi
@eliav-lavi
@solnic Would be interesting to see how he approaches that problem... Right now this kinda blocks me from adopting Hanami to my next project. Which leaves me kinda lost I guess - I feel like my best shot now is to assemble everything on my own, Roda\Sinatra for routing + ROM (I build an API, all jsons, no need for views at all)
Piotr Solnica
@solnic
@eliav-lavi if you build your app using dry-system with whatever else that you prefer and keep strong separation between the routing/http layer and your app layer, then I'm pretty damn sure porting it to hanami 2.0 will be easy
swapping routing front-ends in this architecture really is easy
Eliav Lavi
@eliav-lavi
@solnic yes, I am also a huge RSpec fan but indeed they, as many others, have taken the fact that Ruby is an interpretable, not complied, language, to a bad place. The thing is, it works OK for small CRUD apps but when you have bigger stuff with lots of logic, it's just one big procedural mess :(
Piotr Solnica
@solnic
there is one strong argument that one of the rspec folks said a while ago - rspec-mock can be extremely helpful when dealing with legacy apps
Eliav Lavi
@eliav-lavi
@solnic regarding your suggestion, yes that's my point I guess. I still have to figure out how to incorporate dry-system in my app exactly.
Piotr Solnica
@solnic
which is very true, however, you really gotta be a pro rspec user and know your stuff very well in order NOT to harm yourself :)
Pablo Crivella
@pablocrivella

Any idea how to make this work?

require "dry/container"

module Core
  class Container
    extend Dry::Container::Mixin

    register("transaction") do |input, &block|
      result = nil

      begin
        ActiveRecord::Base.transaction do
          result = block.call(Dry::Monads::Success(input))
          raise ActiveRecord::Rollback if result.failure?

          result
        end
      rescue ActiveRecord::Rollback
        require "pry"; binding.pry
        result
      end
    end
  end
end

I'm getting the following error:

Dry::Transaction::InvalidResultError: step +transaction+ must return a Result object

I guess because the ActiveRecord::Rollback is not being rescued.

Pablo Crivella
@pablocrivella
Okay… it was easier than excpected… sorry for the spamming :sweat_smile:
    register("transaction") do |input, &block|
      result = nil

      Account.transaction do
        result = block.call(Dry::Monads::Success(input))

        raise ActiveRecord::Rollback if result.failure?
      end

      result
    end
Grant Shangreaux
@gcentauri
haha i was going to say maybe the result wasn't always getting returned
i have a question on dry-validation... is it possible to export a JSON schema file based on a dry schema? I find the dry/ruby stuff much easier to read but my work still depends on JSON schemas
Tristan Mortimer
@Qwuke
Hey all, I was wondering whether or not anyone knew of any examples of dry-rb/dry-monads being used in an API client library - am curious how that type of error handling would look in a somewhat fleshed out project
Grant Shangreaux
@gcentauri
is it possible to write a dry predicate that depends on more than one value?
Kasper Sacharias Roos Eenberg
@kse
I use dry-validation for validating input, is there a way to fail if it encounters keys I have written a rule for?
In essence, I want it to be strict.
Alexandru Beu
@alexandrubeu
hey, I'm using dry stack and I have a question related to dry-container in relation with dry-system. Is it possible to have scoped per request dependencies? Thanks
Nikita Shilnikov
@flash-gordon
@alexandrubeu nothing working OOTB. You can create a container on every request, though, with a certain amount of effort this should be good enough. At least I did this, but now I'm experimenting on providing context-aware dependencies using a different approach. If it works fine (atm it appears so) I'm going to build another library for this, it's a matter of months
Alexandru Beu
@alexandrubeu
thanks a lot... I will try to create another container which will be handled by the web.rb hooks :before and :after
Nikita Shilnikov
@flash-gordon
btw, what do you want to add there?
Alexandru Beu
@alexandrubeu
I would like to inject some dependencies like a tenant which should be registered every time a request has arrived. Based on that fact I don't need to pass the param tenant in all my app
Nikita Shilnikov
@flash-gordon
exactly my case
Christian Georgii
@cgeorgii
Hey @flash-gordon, not sure if you had the chance to check this dry-rb/dry-types#277 out? I think we're just waiting for your input. No hurry, though, just don't want the momentum to get lost.
Nikita Shilnikov
@flash-gordon
on my list, working on dry-configurable atm
Christian Georgii
@cgeorgii
Ok, thanks for letting me know ;)
Kumayl Nazary
@knazary
Hey @timriley, appreciate you guiding me here!
I'm working at a company and we've been building an API to replace our legacy java platform.. everything has been going well in the past year up until very recently. Our ruby application (the api) is dockerized and deployed to AWS' Elastic Container Service.
However, after the latest changes, when I try to deploy (building and publishing via docker), on the bundle install step (from my dockerfile), I receive this error: `fatal: Could not parse object '#{some long hash}'.
Any idea how I could fix this? @timriley @solnic
Tim Riley
@timriley
@knazary there’s not enough information to help you here, and the error could be coming from anything, really, not necessarily anything to do with dry-rb.
@knazary Also, we cannot provide support related to application deployment. This is outside our purview as gem developers.
Kumayl Nazary
@knazary
This happened ever since the rodakase repo was archived. I think there may have been specific commits removed?
got it.
Tim Riley
@timriley
@knazary yeah, maybe some commits disappeared. You should 100% no longer be using rodakase. That project was converted to dry-web, dry-system, dry-view a long time ago.
Piotr Solnica
@solnic
:point_up_2:
Tim Riley
@timriley
Rodakase was also very clearly a bleeding edge/experimental project, we didn’t get anywhere even close to guaranteeing stability there
Kumayl Nazary
@knazary
Guys, you are the geniuses. I'm a 25 year old mediocre developer struggling with legacy code here :D
Tim Riley
@timriley
I would definitely encourage you move off that and onto the corresponding dry-rb gems.
In the meantime, perhaps there’s a checked out copy of that commit in your local bundle cache
Kumayl Nazary
@knazary
haha, thanks for pointing me towards the real solution though
Piotr Solnica
@solnic
:point_up_2: ^2 :smile:
Tim Riley
@timriley
you might be able to save yourself by finding that and pushing it up to your own repo
However, do NOT let that prevent you from doing the right thing and getting off that repo ASAP
Kumayl Nazary
@knazary
Got it. This was great. In relation to my local bundle cache, which file(s)/directory would be the right one to push to a repo of my own?
Tim Riley
@timriley
If it’s a git repo clone, you want to push the whole thing up
Kumayl Nazary
@knazary
image.png
Tim Riley
@timriley
¯_(ツ)_/¯
Just find a working local cached copy, if you can, push it up, then point your Gemfile to that repo’s master
I have no idea if this will work, but it’s something
It’s late here and I don’t have the time to look into bundler’s internals right now so unfortunately I can’t help further