Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 30 05:17
    jacortinas starred dry-rb/dry-initializer
  • Nov 29 01:53
    woarewe commented #439
  • Nov 29 00:33
  • Nov 29 00:27
    woarewe commented #439
  • Nov 29 00:27
    woarewe commented #439
  • Nov 29 00:02
    woarewe commented #439
  • Nov 28 06:13
    erik-brueggemann starred dry-rb/dry-monads
  • Nov 28 00:42
    hangsu starred dry-rb/dry-monads
  • Nov 27 13:58
    fapdash starred dry-rb/dry-types
  • Nov 26 08:40
    solnic commented #34
  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:23

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

Philip Arndt
@parndt
so this is rom-http doing it
(the latest, from GitHub)
should I subclass Dry::Struct instead @timriley?
Philip Arndt
@parndt
actually that won't work because it complains that it must be a subclass of ROM::Struct
Tim Riley
@timriley
@parndt you’re doing the right thing
I’m just not sure why you need the transform_types declaration
Tim Riley
@timriley
@parndt FWIW type optionality (“does this single type accept nil?”) and required/not-required struct keys (“can this struct be initialized without a value being passed for this key?”) are indeed different things
Anyway I’d love to be able to help you with your specific problem, if you still have one
Christopher Swasey
@endash
Hell is: doing a complicated reshuffling of a project, then finally seeing all tests go from red to green... except for 1.
Oskar Szrajer
@gotar
:)
Jeff Dickey
@jdickey
Nope. Hell is getting that test to go green…and then running tests again, and seeing 1/3 seemingly randomly go red, then running again and realising that somehow, half of your tests now exercise Heisenbugs
Philip Arndt
@parndt
@timriley Ahhh that is good to know. What I'm after is the ability to initialize the struct without the key/value being passed. Good old NoSQL!
Peter Solnica
@solnic
@parndt why?
Philip Arndt
@parndt
Because sometimes a node doesn't have a particular key yet
rather than putting keys with null values into the store, the key is just not added to the node
so then I see this:
Dry::Struct::Error: [Entities::Page.new] :myTestOptionalKey is missing in Hash input
from /home/parndt/.gem/ruby/2.6.2/bundler/gems/dry-struct-6a56dcac248d/lib/dry/struct/class_interface.rb:233:in `rescue in new'
Caused by Dry::Types::MissingKeyError: :myTestOptionalKey is missing in Hash input
from /home/parndt/.gem/ruby/2.6.2/bundler/gems/dry-types-438161862ed5/lib/dry/types/schema.rb:265:in `block in resolve_missing_keys'
Philip Arndt
@parndt
so I'm guessing I need to somehow tell it that key is not always going to be there at the entity level, hence my wee hack:
module Entities
  class Page < ROM::Struct
    transform_types { |type| type.optional? ? type.required(false) : type }
  end
end
@solnic does that help?
Peter Solnica
@solnic
@parndt yes, I think we want a no-schema struct in the core for cases like this
Philip Arndt
@parndt
yep - I'd still like to define a schema at the repository level, primarily so that weird data can't be saved
I've been working on writing a library for ROM called rom-firebase :smile: :scream:
Peter Solnica
@solnic
@parndt yeah this is a perfectly legit use case. We should have a nice support for this in the core so that various adapters can leverage it
Philip Arndt
@parndt
I'll be pushing my library to GitHub really soon, as soon as I get the example in the readme working :wink:
keen to see what you think... I've been writing it as someone who's not has his head in the dry-rb game for a little while so it's been quite fun
Tim Riley
@timriley
@parndt that’s exciting!
Philip Arndt
@parndt
yeah, my over-eager refactor broke some things so I'll have to keep you in suspense
:grimacing:
Peter Solnica
@solnic

@/all Hey folks, we've been testing Zulip as a Gitter replacement for the last few days. So far it feels really great and we'd like more people to sign up and check it out. We did not decide yet if we want to switch but it's likely that we will, because of this please sign up and let's chat there whether you like it or not.

You can sign up right here: https://dry-rb.zulipchat.com/register/

If you haven't heard about Zulip, it's an OSS communication platform. Something between a chat and email, with a unique communication model based on streams and topics. The company behind it was acquired by Dropbox, but they open sourced the project back in 2015. Its development is very active and it looks promising in general.

Check out Why Zulip here: https://zulipchat.com/why-zulip/

Philip Arndt
@parndt
awesome - zulip's great!
Peter Solnica
@solnic
it's pretty awesome indeed, looks so-so but functionality-wise it's fantastic
Nick Sutterer
@apotonick
Cool, I will check it out
Oh wow, they address so many things I hate about Slack :grimacing:
Philip Arndt
@parndt
@apotonick exactly!
Nick Sutterer
@apotonick
Phil!!!!! :heart_eyes:
Philip Arndt
@parndt
:heart: :heart: :heart:
Christopher Swasey
@endash
Maybe I'm dumb but I can't figure out how just to say something
Christopher Swasey
@endash
bonus feature
Nikita Shilnikov
@flash-gordon
it’s not on you, find the reply button
Spencer Goh
@dymaxionuk
Hi, I'm trying out the Dry::Monads::Do notation, but I get LocalJumpError: yield called out of block. Any ideas why?
Nikita Shilnikov
@flash-gordon
Mind to share an example?
Spencer Goh
@dymaxionuk

@flash-gordon , I've figured it out! seems like a clash between the mixin Dry::Transaction::Operation as soon as I include that it breaks. That Operation mixin includes...

Dry::Matcher.for(:call, with: Dry::Matcher::ResultMatcher)

which wraps :call and clashed with the Do wrapping.

Tim Riley
@timriley
@dymaxionuk hmm, we have an integration test in dry-matcher to ensure it works with dry-monads do notation IIRC
Spencer Goh
@dymaxionuk
Hi Tim, that's suprising... cos I just typed out an example and flattened all the Dry::Transaction::Operation includes into the top level of my class
and it blew up with that ResultMatch
Tim Riley
@timriley
Hmm, could you please file an issue with your gem versions and example case?
Spencer Goh
@dymaxionuk
class MyOp
  include Dry::Monads::Result::Mixin
  include Dry::Matcher.for(:call, with: Dry::Matcher::ResultMatcher)
  include Dry::Monads::Do.for(:call)

  def call
    _should_fail_fast = yield one('hello')
    Success(:yesyesyes)
  end

  def one(param)
    Failure(:nonono)
  end
end

MyOp.new.call
Nikita Shilnikov
@flash-gordon
it can fail if you include modules in the wrong order
Spencer Goh
@dymaxionuk
I'll raise an issue, it might be some clash with the versions I'm using...
Nikita Shilnikov
@flash-gordon
first do, then matcher
this is the right way