[MacRuby-devel] Stream of Consciousness Testing Log

Laurent Sansonetti lsansonetti at apple.com
Mon Mar 31 19:34:09 PDT 2008


On Mar 31, 2008, at 5:34 PM, Pierce T. Wetter III wrote:
> Ok, rewriting things as I go to use the new call syntax. Not as bad  
> as I thought it would be because there are a lot of single parameter  
> or zero-parameter methods I use.
>
> Hmmm...
>
> framework 'PDFKit"
>
> doesn't work, have to use
>
> framework "Quartz"

Yes, because PDFKit is not a main framework but a framework part of  
Quartz, as you noticed.

RubyCocoa has a builtin shortcut when you require PDFKit, because it  
also has to load the bridge support file for it.

In MacRuby, in theory all the dependent bridge support files should  
automatically be read when you require a framework.

$ macruby -e "framework 'Quartz'; p PDFView"
PDFView

By default, Quartz won't be loaded because Cocoa doesn't explicitly  
depend of it (it only depends on QuartzCore).

> kvc_accessor is gone...

Ultimately pure Ruby accessors will work in this case.

http://trac.macosforge.org/projects/ruby/ticket/40

> ib_outlets is now ib_outlet

Same here, I will most probably remove ib_outlet form MacRuby and  
suggest people to write Ruby accessors instead.

> Hmmm.. NSRect has changed:
>
> /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ 
> Resources/NoteTitleBarView.rb:19:in `new': wrong number of arguments  
> (4 for 2) (ArgumentError)
> 	from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ 
> Contents/Resources/NoteTitleBarView.rb:19:in  
> `<class:NoteTitleBarView>'
>
>
>  CLOSE_BOX = NSRect.new(3, 2, 8, 8)
>
> Ok, Wiki says I have to make a Point and a Size now I guess:
>
>  CLOSE_BOX = NSRect.new(NSPoint.new(3, 2_), NSSize.new(8, 8))

I will support the RubyCocoa way, because currently it's too painful  
to construct an NSRect.

Also, notice that NSMakeRect is currently not supported (because it's  
an inline function, and that the bridgesupport dylib files that ship  
with Leopard have not been compiled for GC).

> Hmmm.. No:
>
> 	objc_method
>
> Not necessary I guess.

I will introduce a way to retype a given Ruby method in the runtime,  
but in theory this shouldn't be needed by most (all?) developers.

All Ruby methods are currently registered in the runtime.

> Can't find 'CoreGraphics'

Because it's part of QuartzCore, which is pre-loaded when you require  
Cocoa.

$ macruby -e "framework 'Cocoa'; p CGRect"
CGRect

> Hmmm... Can't find a Framework I copied into Resources?
>
> (i.e. framework 'ILCrashReporter') isn't working.

That's an annoying bug, could you file it in the tracker?

> Ok, removing that for now...
>
> Doh! Roadblock:
>
> /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 
> 1.9.0/openssl.rb:17:in `require': can't freeze pure objc object  
> ` 
> [:TLSv1 
> , :TLSv1_server 
> , :TLSv1_client 
> , :SSLv2 
> , :SSLv2_server 
> , :SSLv2_client 
> , :SSLv3 
> , :SSLv3_server 
> , :SSLv3_client 
> , :SSLv23, :SSLv23_server, :SSLv23_client]' (RuntimeError)
> 	from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ 
> ruby/1.9.0/openssl.rb:17:in `<top (required)>'
> 	from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ 
> ruby/1.9.0/net/https.rb:102:in `require'
> 	from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ 
> ruby/1.9.0/net/https.rb:102:in `<top (required)>'
> 	from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ 
> Contents/Resources/toodledo/session.rb:6:in `require'

Should be fixed in trunk/r127 :-)

Laurent


More information about the MacRuby-devel mailing list