Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

job_list self.respond_to? responds to empty @set_variables #830

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

brunolarouche
Copy link

Since version 1.4.3 (ruby/irb@v1.4.3...master), irb ruby gem (https://github.com/ruby/irb) is calling directly "respond_to?" method on all included code inside a project. That change makes all code included in a project having that method crashing if implementing it in a way not always returning a true or false, like described in the ruby doc: https://www.rubydoc.info/stdlib/core/Object:respond_to%3F

So, I just wanted to propose that simple change which would prevent that (and maybe) other situations, now always returning a value. I've not used the Ruby '&' in order to be retro-compatible with pre-2.3 ruby versions, in case.

@crevete
Copy link

crevete commented Dec 2, 2022

ping @benlangfeld

@neualiluj
Copy link

I am also affected by the issue @benlangfeld

@crevete
Copy link

crevete commented Dec 15, 2022

Hello @trungtran1512, do you have any idea about when this PR will be merged and when a new release will be cut? thanks

@trungtran1512
Copy link

Hello @crevete, I don't know about this but I tried under local it works fine.

@crevete
Copy link

crevete commented Feb 21, 2023

Hello @trungtran1512 who is the maintainer of this project? I guess @benlangfeld? Why he does never respond? Is this project dead? The code base is out-to-date...

@benlangfeld
Copy link
Collaborator

@crevete #618 (comment)

@tompng
Copy link

tompng commented Apr 5, 2023

I think it shuold be fixed as

- def self.respond_to?(name, include_private = false)
+ def respond_to?(name, include_private = false)

@@ -38,7 +38,9 @@ def method_missing(name, *args, &block)
end

def self.respond_to?(name, include_private = false)
@set_variables.has_key?(name) || super
if @set_variables

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will always be nil so this is effectively just super

@brunolarouche
Copy link
Author

I think it shuold be fixed as

- def self.respond_to?(name, include_private = false)
+ def respond_to?(name, include_private = false)

Makes sense, I've updated the PR, thanks!

groyoh added a commit to happydemics/whenever that referenced this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants