These are chat archives for dry-rb/chat

21st
Feb 2018
Alejandro E. Babio
@alejandrobabio
Feb 21 2018 01:05
No trouble at all
Jonah
@jonahx
Feb 21 2018 05:23
separate question: say you use a few custom string utility functions that are defined on a module, and some class uses the. typical solution is to require ‘my_string_utils’ and then either include it within the class that uses it; or hardcode stuff like StringUtils.method into the classes methods; or pass StringUtils into the class’s constructor, and then use it as needed without a hardcoded dependency. The auto_injector could clearly be used to implement the final solution, which is typically the best one anyway. what about having the container register the individual functions, so that you could include them with exactly the granularity you need? thoughts on the wisdom of this? is there any builtin support for doing this as a bulk registration, or would you have to manually register each of the functions if you wanted to do something like this?
Piotr Rybarczyk
@Argonus
Feb 21 2018 16:16
Hi, Do you have versioning of documentation? That would be awesome :)
Gustavo Caso
@GustavoCaso
Feb 21 2018 16:27
Not yet @Argonus. Is something we need to tackle, I completly agree with you it would be awesome
Scott Treppa
@streppa
Feb 21 2018 20:08
Hey guys. Having some trouble figuring out what happened between v0.4.4 and 0.4.5 of 'dry-auto_inject'. i might be doing something that isn't supposed to be done but I'm not sure. I've created a contrived example.
At the bottom of the script is how I want to interact with my lib. I had to juggle some things to get it working how I wanted.
But transitioning from dry-auto_inject 0.4.4 to 0.4.5+ results in an argument error. I'm pretty sure it on the 'super' call in MadLib#intialize.
'super' has to be called to get the injection to work.
Scott Treppa
@streppa
Feb 21 2018 20:17
My actual implementation is for a ruby json api wrapper. I'd like to be able to set some values wrapper wide but with the ability to instantiate a new client with new parameters if necessary.
So... set host and api version in the configuration step but authentication credentials and other options might be different from client instantiation to instantiation.