-
Notifications
You must be signed in to change notification settings - Fork 726
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
base: main
Are you sure you want to change the base?
Conversation
ping @benlangfeld |
I am also affected by the issue @benlangfeld |
Hello @trungtran1512, do you have any idea about when this PR will be merged and when a new release will be cut? thanks |
Hello @crevete, I don't know about this but I tried under local it works fine. |
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... |
I think it shuold be fixed as - def self.respond_to?(name, include_private = false)
+ def respond_to?(name, include_private = false) |
lib/whenever/job_list.rb
Outdated
@@ -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 |
There was a problem hiding this comment.
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
Makes sense, I've updated the PR, thanks! |
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.