Re: [MacRuby-devel] URI and NSURL compatibility

2010-10-07 Thread Joshua Ballanco
This is Ruby, where everything is an expression. If you're going to be clever, why not go all the way? --- def is_macruby?; defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'; end if is_macruby? framework 'Foundation' else require 'uri' COMPONENTS = [:scheme, :userinfo, :host, :port, :regis

Re: [MacRuby-devel] URI and NSURL compatibility

2010-10-07 Thread Laurent Sansonetti
Hi Mark, No, NSURL and URI are not bridged. I do not recommend using NSURL in a file that should also run under MRI because of the MacRuby calling syntax for Objective-C selectors, which won't compile under normal rubies. So, it would be better to isolate the NSURL code in a special file and r

Re: [MacRuby-devel] URI and NSURL compatibility

2010-10-07 Thread Mark Rada
A more efficient version of that class: class HackURI if RUBY_ENGINE == 'macruby' def initialize(uri) @url = NSURL.URLWithString uri end else def initialize(uri) @url = URI.parse uri

[MacRuby-devel] URI and NSURL compatibility

2010-10-07 Thread Mark Rada
Hi devs, I am trying to write a gem so that it will run on MRI and MacRuby, but still be able to take advantage of MacRuby things like Cocoa and GCD. I was playing around with some URI related stuff and I cannot find much documentation on whether NSURL and URI objects have been bridged for MacR

Re: [MacRuby-devel] Is CoreText Fully Support

2010-10-07 Thread dianhui nie
Ok. I'll do this later when i was home : ) On Oct 8, 2010, at 10:17 AM, Laurent Sansonetti wrote: > Hi, > > Could you reduce the problems to simple .rb scripts and attach them to a new > ticket? > > We are working on a new version of BridgeSupport which will add missing > metadata (I believe i

Re: [MacRuby-devel] Is CoreText Fully Support

2010-10-07 Thread Laurent Sansonetti
Hi, Could you reduce the problems to simple .rb scripts and attach them to a new ticket? We are working on a new version of BridgeSupport which will add missing metadata (I believe it will fix your CoreText problems), but we will need to verify. In the interim, you can wrap CoreText APIs in O

[MacRuby-devel] Is CoreText Fully Support

2010-10-07 Thread 聂殿辉
Hi I'm doing some work with CoreText with macruby ,and i had some question 1. CTline and some other `struct` does not have a ruby class ,the ctline.class is __NSCFType , not like the CGRect struct,in macruby ,the class is CGRecct ,so i can reopen the class ,and add some help methods. 2. the CT

Re: [MacRuby-devel] Tutorial for the new Sandbox class.

2010-10-07 Thread Rob Gleeson
Okay, I modified the document a tiny bit making note of the return value of #apply!, and the SecurityError exception it can raise: http://github.com/robgleeson/macruby_website/blob/Sandbox_class_tutorial/content/documentation/the-sandbox-class.txt ___ M

Re: [MacRuby-devel] Tutorial for the new Sandbox class.

2010-10-07 Thread Rob Gleeson
On 7 Oct 2010, at 10:49, Nick Ludlam wrote: > Hi Rob, > I like the tutorial, it's nicely short and concise. One thing I'd like to see > is the expected outcome of running the code you've placed within the text. > Could you include this information underneath the code blocks? > > I'm imagining

Re: [MacRuby-devel] Tutorial for the new Sandbox class.

2010-10-07 Thread Nick Ludlam
Hi Rob, I like the tutorial, it's nicely short and concise. One thing I'd like to see is the expected outcome of running the code you've placed within the text. Could you include this information underneath the code blocks? I'm imagining that most people would try this out using the interactive

Re: [MacRuby-devel] Tutorial for the new Sandbox class.

2010-10-07 Thread Rob Gleeson
On 7 Oct 2010, at 07:55, Matt Aimonetti wrote: > Thx I'll merge the article asap (after a quick sanity check). > > - Matt > > Sent from my iPhone > Thanks Matt. ___ MacRuby-devel mailing list [email protected] http://lists.macosfo