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

Support on_*_entry, on_*_exit and implicit callback methods being private. #37

Closed
wants to merge 1 commit into from
Closed

Support on_*_entry, on_*_exit and implicit callback methods being private. #37

wants to merge 1 commit into from

Conversation

danp
Copy link

@danp danp commented Oct 15, 2011

Passing true as the second argument to respond_to? searches methods that have been marked private as well. This patch adds that so callback methods can be private.

@geekq
Copy link
Owner

geekq commented Oct 21, 2011

My concern is the compatibility to different Ruby versions. I intend the workflow library to work with Ruby 1.8.6, 1.8.7 and 1.9.*. I remember the old discussions like http://deaddeadgood.com/2008/11/17/rubys-send-method/

@danp
Copy link
Author

danp commented Oct 25, 2011

Understood.

According to this, 1.8.6 through 1.9.2 support respond_to? with the second argument.

According to this (and from what I recall, need to do some digging in the source history to verify), only 1.9.1 has the send semantics of only working with public methods. As that blog post says when send didn't work for private methods there was also send! for that, though I'd need to verify that as well.

It's arguable the behavior for 1.9.1 users would be unchanged; though if they saw in the documentation private methods were supported they would be confused when it didn't work for them.

If it's possible, would you be ok with a solution that used send! instead of send when necessary?

@danp
Copy link
Author

danp commented Oct 6, 2012

Looks like this was fixed by @dwbutler in 53e7ae1 as part of #53. Closing.

@danp danp closed this Oct 6, 2012
@korny
Copy link

korny commented May 28, 2013

Actually, #53 only fixed this for implicit callbacks, but not for on_*_entry and on_*_exit calls. I'd propose using the smart has_callback? method in run_on_entry and run_on_exit, too.

@korny
Copy link

korny commented May 28, 2013

Pull request is in #81.

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.

3 participants