rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
422 stars 66 forks source link

Repl - Adding methods to Kernel conflicts with method_missing #200

Open ijpiantanida opened 9 years ago

ijpiantanida commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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.