[MacRuby-devel] Ruby and JSCocoa — A bridge fr om Ruby to JavascriptCore too far?

2010-06-09 Thread Ernest N. Prabhakar, Ph.D.
Hi all,

Okay, this is probably a completely insane idea brought on my 
WWDC/toddler-induced sleep deprivation, but...

Given all the hoopla around node.js lately, I've been playing around with 
JSCocoa to see what can be don with JavaScript on the Mac:

http://inexdo.com/JSCocoa

Alas, my ObjC skills have atrophied (or maybe just spoiled by Ruby), so I've 
looked with envy at various Ruby-in-JavaScript solutions:

cowboyd's therubyrhino at master - GitHub

therubyracer

jbarnette's johnson at master - GitHub

The simplest of these is Rhino, since it already "boxes" up JavaScript inside 
the Java object model, which bridges trivially to JRuby.

If I squint just right and don't think too hard, it seems like I should be able 
to do the same thing with JSCocoa from MacRuby.  That is, use JSCocoa as a 
"JavaScript API to real objects" translator, then MacRuby to access those 
objects from there.

The tricky part is that JSCocoa still passes around a bunch of C structs (JS 
Data types).  But presumably Bridge Support can take care of (most) of that for 
me? Or am I overlooking something profound?

-- Ernie P.



___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] REXML

2010-06-09 Thread Robert Rice
Note to REXML users.

I suspect that there is a bug in the each_element method of REXML. In the 
each_element loop I would get intermittent errors where the index was not a 
REXML element or I would get a Bad Instruction crash with no traceback. My 
system became stable after replacing calls to each_element with elements.each.

Bob Rice

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] ImageAndTextCell

2010-06-09 Thread Robert Rice
Has anyone used Apple's ImageAndTextCell in a MacRuby example? ImageAndTextCell 
is included in the "DragNDropOutlineView" sample code.

Thanks,
Bob Rice

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #744: map on an array delivered by terminal app via scripting bridge gives an immutable error

2010-06-09 Thread MacRuby
#744: map on an array delivered by terminal app via scripting bridge gives an
immutable error
+---
 Reporter:  jazz...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.7  
Component:  MacRuby |Keywords:   
+---
 {{{
 $ cat term.rb

 framework 'ScriptingBridge'

 term = SBApplication.applicationWithBundleIdentifier('com.apple.terminal')

 p term.windows
 p term.windows.class.ancestors
 p [term.windows.first].map { |w| w.name }
 p term.windows.map { |w| w.name }
 }}}

 {{{
 $ macruby term.rb
 [#]
 [Array, NSMutableArray, NSArray, Enumerable, NSObject, Kernel]
 ["Terminal — macruby"]
 /Users/box/macrubyscripts/term.rb:5:in `': can't modify
 frozen/immutable array (RuntimeError)
 }}}

 MacRuby 0.5 gives no error.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel