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

Repl - Adding methods to Kernel conflicts with method_missing #200

Open
ijpiantanida opened this issue Apr 23, 2015 · 2 comments
Open

Repl - Adding methods to Kernel conflicts with method_missing #200

ijpiantanida opened this issue Apr 23, 2015 · 2 comments

Comments

@ijpiantanida
Copy link
Contributor

Repl works by extending the Kernel module.

This means that you can't use method_missing on your app for example to proxy the size method to another object, since now Kernel responds to it (in an unintended way).

Why not just open the TopLevel class and add the repl helpers there instead?

@jamonholmgren
Copy link
Contributor

There's also some sort of a ReplHelper class or module or something available. I've never found documentation on it, but it's there.

@ijpiantanida
Copy link
Contributor Author

You mean the SugarCube::Replclass? That's what the Kernel methods end up calling.
It used to be a module SugarCube::Adjust, so I would simply include it myself on the REPL instead of requiring the package. But now that it's a class (don't know why since it doesn't have any instance method) I can't do it anymore.

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

No branches or pull requests

2 participants