Giter Site home page Giter Site logo

Comments (6)

dgutov avatar dgutov commented on July 26, 2024

Hi!

I looked into this case and it seems that it's because exifr overrides Class#instance_methods to include additional entries in the return of instance_methods but didn't include that in instance_method.

That sounds like a bug: it violates the contract of those methods, seems like. Have you tried reporting it?

My proposed solution to this is to rescue NameError for the candidates mod.instance_method(sym).

I'm not sure it's the right approach: if the methods we call are allowed to do whatever (and essentially, they do), then rescuing NameError may not be enough as well. instance_method may raise a different error, or instance_methods may start raising errors or return unexpected values.

Maybe that calls for a circumvention of said override, like we do for a few methods already: 9a33e54

But I still have a question about why EXIFR::JPEG is scanned when scanning candidates for an instance of a totally unrelated class.

Because Robe performs almost no type inference, and when it does not know the type, it scans all classes and modules. It's explained in README.md.

from robe.

aifreedom avatar aifreedom commented on July 26, 2024

Hi Dmitry, thanks for the prompt reply! I agree that this is a bug in that gem. I'll report it to them.

I'm not sure if my approach is the right one. But I think that rope shouldn't be broken when scanning a gem with bug. Using begin ... rescue ... end is one way to protect rope from being affected. There might be better ways to do it of course. I'm not familiar enough with robe's code. Do you have better ways to make it more robust?

from robe.

dgutov avatar dgutov commented on July 26, 2024

I'll report it to them.

Let me know how it goes.

There might be better ways to do it of course. I'm not familiar enough with robe's code.

Have you looked at the linked commit?

from robe.

ypresto avatar ypresto commented on July 26, 2024

I have same issue on EXIFR::JPEG

from robe.

dgutov avatar dgutov commented on July 26, 2024

Ok, let's try the workaround.

from robe.

ypresto avatar ypresto commented on July 26, 2024

Now works well, thanks!!!

from robe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.