Closed GustavoCaso closed 6 years ago
Hi Gustavo, last time I got stuck on the feeling that I missed some use cases. It would be great to have an exhaustive test suite for this feature.
I think it's worth to disturb @abinoam @jodosha and other guys and ask to review the test suite.
Hi @Ptico, of course, the more the better. I just started with one possible solution and see where it gets me. Please feel free to add any comment you find necessary
Don't see the problem with storing them in a hash personally, but probably missing something?
@AMHOL maybe instead of a simple Hash we could use Concurrent::Hash
@GustavoCaso could do, not sure it's necessary as the configuration should probably be done before any forking / threading happens, but no harm in it I guess.
I think dynamic inflection configuration is a rare case which smells very-very bad. So, plain old hash is ok
OK, I added support for underscore
but @Ptico is right, we need more specs, I'll have another look soon. I'm not happy with code but it doesn't matter, we can improve it later once we have all cases covered.
@jodosha heh, it's mostly me, I ported specs and code from activesupport because they're obviously good enough for our case but it's not finished yet, as you pointed docs are missing and I need a fresh look by myself to clean up the resulted implementation (I'm not happy with it atm). I'll get back to it this week, thanks for the input!
Okay, this is good to go, I ended up with creating a separate class for acronyms since they affect different operations and I'm not sure how to unify them within Rules
. Anyhow, this doesn't look to be a big deal after all. WRT hashes and potential concurrency issues I think we could turn the whole library into a thread-safe one but this is a separate task because we need to change Rules
as well.
I'm merging this with the intent to use acronyms in dry-types, feel free to provide feedback though.
@Ptico @flash-gordon
I started the work on the topic for learning purposes to get familiar with the library and also to have a discussion on how to implement it.
So far I'm not truly happy for storing the acronyms in a
Hash
.Todo
camelize
humanize
(I have modified the test because by definition humanize the first word and the rest are downcase)underscore