[MacRuby] #1226: Ruby methods are not available to JS objects within a windowScriptObject unless respondsToSelector is explicitly called
MacRuby
ruby-noreply at macosforge.org
Sat Apr 16 18:59:15 PDT 2011
#1226: Ruby methods are not available to JS objects within a windowScriptObject
unless respondsToSelector is explicitly called
---------------------------------------+------------------------------------
Reporter: greg.borenstein@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: major | Milestone:
Component: MacRuby | Keywords:
---------------------------------------+------------------------------------
Working through Matt Aimonetti's basic example for how to communicate
between Macruby and JS using a webview instance and a windowScriptObject,
I discovered that I had to call "respondsToSelector(my_instance_method)"
on my ruby object in order to make my_instance_method accessible from
within javascript. The following gist shows a macruby class
(BratPackDelegate) that is trying to provide access to a ruby class called
Project to javascript within an HTML page loaded by a webview (the HTML/JS
is also included in the gist):
https://gist.github.com/923663
If line 43 of bratpackdelegate.rb (@project.respondsToSelector("start"))
is removed, then line 13 of home.html (project.start()) no longer
functions.
Matt asked me to post this bug here so I am doing so.
Please contact me if any additional information or explanation is needed.
thanks,
Greg Borenstein
--
Ticket URL: <http://www.macruby.org/trac/ticket/1226>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list