hanami / utils

Ruby core extentions and class utilities for Hanami

Home Page:http://hanamirb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hanami::Utils::BasicObject#inspect doesn't output anything

nfilzi opened this issue · comments

Hey guys! I noticed a rather strange issue while trying to implement an interactor in my Hanami application. When the Result object was returned at the end of my interactor run, nothing was displayed in the terminal. By nothing, I do not mean nil, just plain nothing.

I somehow managed to pinpoint it up to the Hanami::Utils::BasicObject#inspect method, but I'm stuck on how to fix it, so I can't offer you a nice PR :(

Here's a diff screenshot, where first the inspect method is enabled, second I just comment it out.

hanami-utils-basic_object-inspect-bug

Let me know if you need more extra information!
And thank you for your time 🙇

Hi @nfilzi thanks for the issue, could you provide more info about your interactor?

@nfilzi I played a bit with this problem: for some reason this fails only with Pry. It invokes Hanami::Utils::BasicObject#inspect, but it does print out the output string of that method.

Apparently Pry doesn't uses #inspect but #pretty_print (from Ruby's pp).
Source: https://stackoverflow.com/a/36664061/498386

@nfilzi Would you mind to try this fix? #237 Thanks

It's working like a charm, thanks a lot for the swift fix @jodosha !