These are chat archives for dry-rb/chat

24th
Dec 2015
Piotr Solnica
@solnic
Dec 24 2015 12:11
@AMHOL you there?
Andy Holland
@AMHOL
Dec 24 2015 12:21
@solnic hi mate
Piotr Solnica
@solnic
Dec 24 2015 12:40
man, writing tests for global classes with mutable state is killing me ;)
and I gotta say const lookup in ruby is just…doesn’t give me much confidence, let’s put it like that ;)
Andy Holland
@AMHOL
Dec 24 2015 12:44
Lol i hear you
Piotr Solnica
@solnic
Dec 24 2015 12:47
add to that global mutable LOAD_PATH and the way require works and it’s a major PITA to test stuff that deals with those things
Piotr Solnica
@solnic
Dec 24 2015 13:14
@AMHOL is it possible that _container is somehow the same for two classes that are being removed between the examples run? :joy:
because that’s what I see
do you cache _container somehow and store it somewhere so that it doesn’t get removed properly?
I remove class constants between examples BUT their _container stays the same, this is concerning
I just triple-checked this
and can confirm this is what happens
Piotr Solnica
@solnic
Dec 24 2015 13:23
ugh, ok man we have a bug in dry-container, in inherited hook we gotta @_container.dup otherwise multiple classes will get THE SAME hash set :(
I’ll patch it and push a bug fix release
Andy Holland
@AMHOL
Dec 24 2015 13:28
Sorry mate, was sorting out xmas stuff
Cheers for that
@solnic how come you prefer if block over if block_given?
Piotr Solnica
@solnic
Dec 24 2015 13:43
Less typing
And does not require stupid _block
Andy Holland
@AMHOL
Dec 24 2015 13:44
lol fair point
Piotr Solnica
@solnic
Dec 24 2015 13:45
It would make sense if you did not have &block specified
Otherwise it feels awful :)
Andy Holland
@AMHOL
Dec 24 2015 13:46
Yeah, definitely, I was going to remove the &_block argument but thought it's a good indication that it takes a block argument
Piotr Solnica
@solnic
Dec 24 2015 13:51
btw it feels like extracting dry-component is a good move. When you focus on a small piece of functionality it is easier to narrow down the api and make it more robust AND reusable
Andy Holland
@AMHOL
Dec 24 2015 13:52
Yeah i noticed that you added a couple of things :)
Reusable is defo what dryrb is about too :p
Piotr Solnica
@solnic
Dec 24 2015 13:56
Totally. You should be able to use this in other places like sinatra apps, rails would need extra stuff for the €>{>{~£{!]*%##?{!^ code reloading in dev mode but even that would not be super hard
Hunter Madison
@hmadison
Dec 24 2015 16:48
solnic, you have yet to try to get anyting to work well with spring
its so bad its out in rails 5
Piotr Solnica
@solnic
Dec 24 2015 16:49
@hmadison ain’t gonna bother tbh
Hunter Madison
@hmadison
Dec 24 2015 16:50
fine by me (Only involved with rails for work now)
Piotr Solnica
@solnic
Dec 24 2015 17:03
@hmadison wdym ‘its out in rails 5’?
Hunter Madison
@hmadison
Dec 24 2015 17:20
as far as i've been told, spring is getting dropped for rails 5
(don't quote me on that, this is coming from a coworker)
Piotr Solnica
@solnic
Dec 24 2015 17:47
That is good I hope it's true. I also wonder if they will ever realize what kind of nonsense const reloading in dev mode is
Hunter Madison
@hmadison
Dec 24 2015 18:23
its hilariously bad, the only languages that do it "right" (imo) are erlang and java.