Hi!

I believe you are hitting this bug: http://www.macruby.org/trac/ticket/594
There is a workaround in the first comment: http://www.macruby.org/trac/ticket/594#comment:1

Let me know if that's not it though! :-)

-- 
Thibault Martin-Lagardette



On Jun 7, 2010, at 16:21, Michael Jackson wrote:

Hi,

I'm trying to create an object that conforms to the WebScripting
protocol, but the only method that is working is
invokeUndefinedMethodFromWebScript:withArguments:. Here's a sample of
my class so far. The puts statements are just there so I can see what
is actually being called.

For reference, the WebScripting protocol is defined here:
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/Reference/Reference.html


class HelloScriptObject

 def self.isKeyExcludedFromWebScript(key)
   puts key.inspect
 end

 def self.webScriptNameForKey(key)
   puts key.inspect
 end

 def self.isSelectorExcludedFromWebScript(sel)
   puts sel.inspect
 end

 def self.webScriptNameForSelector(sel)
   puts sel.inspect
 end

 def invokeUndefinedMethodFromWebScript(name, withArguments:args)
   puts name
puts args.inspect
 end

 def sayHi
   puts 'hi'
 end

end


The sayHi method is the one that I'm calling via JavaScript, but every
time it just defaults to using
invokeUndefinedMethodFromWebScript:withArguments: instead of using
self.isSelectorExcludedFromWebScript: to first check if the selector
is valid or not. Is support for this implemented yet (in 0.6)? If so,
what am I missing?

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel