[MacRuby] #821: uncached ObjC stub - Abort trap
#821: uncached ObjC stub - Abort trap ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- {{{ $ cat a.rb begin framework 'Cocoa' rescue NSWorkspaceLaunchWithoutActivation = 512 end p NSWorkspace NSWorkspace.sharedWorkspace.openURLs( [ NSURL.URLWithString('http://www.macruby.org/')], withAppBundleIdentifier:nil, options:NSWorkspaceLaunchWithoutActivation, additionalEventParamDescriptor:nil, launchIdentifiers:nil) }}} {{{ $ macrubyc -o a --static --framework Cocoa a.rb; ./a #<NSWorkspace:0x20026b160> uncached ObjC stub `c@:@@Q@^@' Abort trap }}} Maybe this is a known restriction of the AOT-compilation... -- Ticket URL: <http://www.macruby.org/trac/ticket/821> MacRuby <http://macruby.org/>
Hi, just for those who are interested, I translated John Grubers ‚open urls in safari tabs‘-script to pure MacRuby. The rather complex regular expression for detecting URLs in text is working fine in MacRuby! (AOT-compilation does not work yet, see ticket #821) -- Bernd #!/usr/local/bin/macruby # MacRuby version of http://daringfireball.net/2010/08/open_urls_in_safari_tabs begin framework 'Cocoa' rescue NSUTF8StringEncoding = 4 # defining constants by hand for AOT-compiled version NSWorkspaceLaunchWithoutActivation = 512 end regexp = Regexp.new '(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))' urls = STDIN.read.scan(regexp).uniq.map do |m| NSURL.URLWithString(m.first.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)) end.compact NSWorkspace.sharedWorkspace.openURLs(urls, withAppBundleIdentifier:nil, options:NSWorkspaceLaunchWithoutActivation, additionalEventParamDescriptor:nil, launchIdentifiers:nil)
#821: uncached ObjC stub - Abort trap ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 0.7 => Comment: Please don't use static compilation for the moment, it's under development. Regular AOT compilation (without --static) should work fine. -- Ticket URL: <http://www.macruby.org/trac/ticket/821#comment:1> MacRuby <http://macruby.org/>
participants (2)
-
B. Ohr
-
MacRuby