[MacRuby-devel] Seeing methods of extended ObjC objects in IB
Hey guys, I added the MacRuby framework to an existing project (gitx on github, which uses GC also fortunately). After setting the build to compile 64bit only everything (-1, see below) works fine, so far I can say now. I am impressed! I defined my own controller in Ruby, call methods of it from the user interface and connected this controller to other ObjC-objects and call methods of them. But one thing does not work: If I extend an existing ObjC-Object, f.e. class PBGitHistoryController def do_what(sender) puts "do what?" end end then I don't see this method in the Interface Builder under 'Received Actions'. Is it my fault our yours? If I 'p' this object it says: # Perhaps this (KVO) is the problem? -- But let me say again: I like the MacRuby project so much and I wish I could use it for real development in the near future! Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Flash on the iPhone via LLVM
Hi, I found this interesting article http://www.appleinsider.com/articles/09/10/06/html5_assault_on_adobe_flash_heats_up_with_clicktoflash.html&page=2 , describing how Adobe plans to port it's Flash to the iPhone via LLVM. I have never programmed for Flash (I hate Flash), but I know, that they are using garbage collection for their ActionScript. They are planning a first release for end of the year, so I think they are running already gc-Code on the iPhone. That means: it is time for the first port of MacRuby for the iPhone! Bernd___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] MacRuby 0.5 beta 1
Hi Laurent, I have to thank you (and all the others) for your great effort! When I first saw Obj-C (~1993, I don‘t remember exactly, I got a NeXT computer for testing purposes), my first thought was: What a weird language! At this moment absolutely nobody could foresee, that this will be the future language of choice for the Apple Macintosh. I really hope, that MacRuby will become a fully useable alternative to Obj-C on the Mac! And the 0.5 is already very useable for a beta. Every time when I am doing something in MacRuby (and have to look at Obj-C examples), I can only say: I love that language! Bernd Am 08.10.2009 um 06:13 schrieb Laurent Sansonetti: Hi, The first beta release of MacRuby 0.5 is out! I prepared some notes here: http://www.macruby.org/blog/2009/10/07/macruby05b1.html The goal is to go through a few beta releases before releasing the final 0.5. Please give it a try and report us bugs & feedback :) Laurent ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] XCode MacRuby templates are generating .nib files
Hi, the XCode MacRuby templates are generating .nib files instead of xib files (like Obj-C projects). (.xib is better for diffs in git or svn) Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Translating Obj-C to MacRuby
Hi all!
Using Cocoa in MacRuby is sometimes a hard job, because all
documentation, examples and sample code is Obj-C. For example, I found
this piece of code '[NSNumber numberWithBool:NO]' and asked myself how
to write that in Macruby.
I opened macirb and typed:
> NSNumber.numberWithBool 0
=> false
First I had to laugh and then I thought: Hey implementors of macruby,
you really did a great job!
What do you think about a table on http://www.macruby.org/ which lists
all such short (and astonishing) examples. Or even better, why not
create a command in the services menu which translates a Obj-C
sequence (by regexp).
BTW, the second example I tried is:
> NSDictionary.dictionaryWithObjectsAndKeys "a", "b", nil
but instead of {"b"=>"a"} I got a seg fault! (ticket is filed)
Greets,
Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Translating Obj-C to MacRuby
Hi John,
Am 14.10.2009 um 10:34 schrieb John Shea:
Hi Bernd,
YES and NO in ObjC are translated to true and false in MacRuby.
so you were probably after:
NSNumber.numberWithBool(false)
(I am curious as to how often that is useful actually)
I will leave the table idea for others to comment - I actually think
in the end there are only a few rules to learn and then you will
find yourself translating easily (not that those rules should not go
in a cheat sheet somewhere - that's probably a good idea).
Shure, there are only few rules, but:
1. there are newbies outside (most of the Obj-C programmers)
2. why should I manually correct those Obj-C things like [aObj: foo] a
thousand times when it can easily be done by a regexp? I don't want a
real translator, I am wanting just a simple []-remover!
With:
NSDictionary.dictionaryWithObjectsAndKeys "a", "b", nil
I assume that in the original ObjC method is actually passing an
array which (it seems) must be terminated by a nil (in objC).
I actually ran across this in another context - passing objects in
this way - again I will leave others to comment on it, perhaps it is
an issue.
However why can't you use :
dict = {"b"=>"a"}
=> {"b"=>"a"}
#check class of created dictionary
dict.class
=> NSMutableDictionary
Why use the long winded ObjC form?
Perhaps you misunderstood me. I know this already and I don't want to
use the long form, I just typed that in macirb to use the RESULT (in
this case {"b"=>"a"}). Perhaps this is the way a Obj-C programmer is
trying out MacRuby because of lacking of documentation.
Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Translating Obj-C to MacRuby
Hi,
Am 14.10.2009 um 11:04 schrieb Laurent Sansonetti:
Hi,
On Oct 14, 2009, at 1:03 AM, B. Ohr wrote:
Hi all!
Using Cocoa in MacRuby is sometimes a hard job, because all
documentation, examples and sample code is Obj-C. For example, I
found this piece of code '[NSNumber numberWithBool:NO]' and asked
myself how to write that in Macruby.
You can simply pass true or false and MacRuby will do the conversion
for you.
Oh yes, in my example project , I automatically used true and it
worked. But then I began asking myself, how can I be shure that this
is the correct way and what would an absolute beginner do and then i
opened macirb... ;-)
I opened macirb and typed:
> NSNumber.numberWithBool 0
=> false
First I had to laugh and then I thought: Hey implementors of
macruby, you really did a great job!
And NSNumbers are converted to Ruby types as you just experienced :)
In the docs
+ (NSNumber *)numberWithBool:(BOOL)value
gives a NSNumber and not a TrueClass or FalseClass as in Macruby. I
only wanted to say how impressed I am!
What do you think about a table on http://www.macruby.org/ which
lists all such short (and astonishing) examples. Or even better,
why not create a command in the services menu which translates a
Obj-C sequence (by regexp).
I think a short tutorial/page on the website would be great, indeed.
I don't believe it is easily possible to write an Objective-C ->
MacRuby convertor that works most/all the time (because of the C
nature of ObjC).
Such a cheat sheet can easily show the beauty of MacRuby and the
"noisiness" of Obj-C! ;-)
I agree that a real translator is impossible. What I want is a simple
text processing which removes all the [foo: bar baz] and replaces it
with foo.bar(baz).
BTW, the second example I tried is:
> NSDictionary.dictionaryWithObjectsAndKeys "a", "b", nil
but instead of {"b"=>"a"} I got a seg fault! (ticket is filed)
I replied to the ticket, it seems you forgot to do `framework
'Foundation'' first.
Oh, my fault! But wouldn't it be better NOT to respond with a segment
fault (this irritated me) and instead throw an normal ruby exception?
(But perhaps that is impossible.)
Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Running nanoc3 with MacRuby
Hi, I got nanoc3 working with MacRuby (http://nanoc.stoneship.org/). It‘s a static site generator like webby (I think it is more powerful). I haven't done much yet, just the basic things like create a site skeleton, replace a 'yield' in a layout page (does not work yet, ticket #386), and do some filtering with ERB. Finally i wrote a MacRuby function, where I am parsing calendar events of my iCal (framework 'CalendarStore') to bring them on the website. This is the reason why I am running nanoc with MacRuby, because of the direct access to the Cocoa frameworks. It is working fine! Next I will try to run other filters like Redcloth and Ultraviolet, and things like image- and pdf-processing (with the Cocoa framework) I will give a chance too. Ah, there is one question remaining: nanoc3 uses PStore, which is calling File#flock, which gives an unimplemented error in MacRuby. Does anybody know the state of File#flock? Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Using Gems in MacRuby
Am 16.10.2009 um 04:55 schrieb s.ross: On Oct 15, 2009, at 6:10 PM, Conrad Taylor wrote: On Thu, Oct 15, 2009 at 5:03 PM, s.ross wrote: On Oct 15, 2009, at 1:43 PM, Laurent Sansonetti wrote: Hi Craig, On Oct 14, 2009, at 7:07 PM, Craig Williams wrote: Hi Everyone, I have searched the web but have not found a good explanation on how to use gems in a MacRuby project. Is there a tutorial I am missing? We should definitely write a tutorial about that. The RubyGems support is pretty new so I don't think anybody tried yet to embed gems in a MacRuby app. At a glance I believe it would be a matter of installing the gem inside MacRuby.framework, embed it in the app then change the GEM_HOME environment variable. Laurent Oof. Changing the framework? Maybe I'm not understanding what you're suggesting. Why would it not be enough to install all gems in a vendor/ directory and change GEM_HOME to there? Or something that would not involve embedding (eventually) all gems in use in all apps you're developing inside the MacRuby.framework... Steve Steve, you should be able to install the gem(s) and require them in the relevant file(s). You shouldn't have to unpack the gem(s) into a vendor directory because they should be visible to the Ruby environment after you require it. -Conrad Conrad-- I guess I'm thinking of a case where you didn't want to rely on a particular gem being present on a target machine -- say for an app you were distributing. Naturally, the GEM_HOME built into MacRuby is just fine on *my* machine. But, if I give the app to someone else who may not have a particular gem installed, boom! Steve Steve, another solution would be, that somebody writes a gem-helper, which loads the required gems interactively into macgem when they are missing. This helper should have a Cocoa-UI for the unexperienced user outside and is called at program startup. Upgrading gems and testing a required version are possible features of such a helper. Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] macgem with mixed-in ObjC
Hi, what do you think about a macgem with mixed-in ObjC? This could be useful for supporting native C libraries without using the MRI C interface, for calling parts of the OS X framework that is not Obj-C, for speed optimized code and so on. A macgem could also be delivered with a precompiled .rbo, so it can easily be installed on machines without the Developer tools installed. (I haven't yet tried to run macruby on such a machine ;-) ) BTW, I failed in building an .rbo bundle with a mixed-in ObjC part. Pure Ruby like this macrubyc --arch x86_64 -C "foo.rb" -o "output/foo.rbo" is working, but I didn't find a way to include another .o file generated by gcc. Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] new macruby tips: dialog window
Am 26.10.2009 um 01:00 schrieb Matt Aimonetti: I'm back from vacation and wrote a very simple tutorial: MacRuby tips: create a Cocoa file/folder browser in a few lines of code: http://bit.ly/1VuxBZ Could you please upload the current state to the github repository? It looks like it's time for me to move my tutorials http://merbist.com/category/macruby/ to MacRuby's recipes. Anyone feels like contributing more examples/tutorials? I have written a tutorial about "building a static website with nanoc", but publishing has to wait until ticket #395 is resolved.___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] new macruby tips: dialog window
Am 26.10.2009 um 08:32 schrieb Matt Aimonetti: On Mon, Oct 26, 2009 at 12:26 AM, B. Ohr wrote: Am 26.10.2009 um 01:00 schrieb Matt Aimonetti: I'm back from vacation and wrote a very simple tutorial: MacRuby tips: create a Cocoa file/folder browser in a few lines of code: http://bit.ly/1VuxBZ Could you please upload the current state to the github repository? What do you mean? - Matt Oh, sorry, I thought you wrote your manual on http://www.macruby.org/ ! On http://github.com/mattetti/macruby_website at least the article "test driven development..." is missing. BTW, wouldn't it be better to publish your articles on http://www.macruby.org/ too?___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] spotlight - MDItemRef
Hi Ruben! However I'm still curious about the daily non-Xcode scripts. Image I want to write a macruby script that uses my Objective-C helper class. What's the easiest way to accomplish that outside XCode? Ruben Like you I played around a little with this issue. My current state is: If you have a MacRuby helper named foo.rb you can simply compile it like that macrubyc -V --arch x86_64 -C "foo.rb" -o "foo.rbo" This "foo.rbo" can be included in another script via require. If you have an ObjC you can compile it with gcc -c foo.m -o foo1.o -fobjc-gc but I failed to convert that foo1.o to an .rbo file. I tried some macrubyc options but none of them is working. On the other side making an .o out of a .rb is no problem: macrubyc -V --arch x86_64 -c "foo.rb" -o "foo.o" So I think, there is just one step missing in the options in macrubyc (or I am unable to read the source). Bernd___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Quicklook plugin, Spotlight importer
Hi, I have written a MacRuby class that reads binary data (a special format) from a file. Is there a chance that I can use this class in a Quicklook plugin or a spotlight importer? Both targets don't support GC-memory, but all object instances are created in one procedure with autorelease (NSAutoreleasePool ). So this is a very special case of GC Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [MacRuby] #339: YAML error with UTF-16 string
Am 14.11.2009 um 21:17 schrieb Matthias Neeracher:
On Nov 14, 2009, at 15:44 , MacRuby wrote:
#339: YAML error with UTF-16 string
---
+
Reporter: d...@… |Owner: lsansone...@…
Type: defect | Status: closed
Priority: critical |Milestone: MacRuby 0.5
Component: MacRuby| Resolution: fixed
Keywords: YAML encoding |
---
+
Comment(by jazz...@…):
{{{
$ macruby -e 'require "yaml"; puts "Rübe".to_yaml'
--- "R\xFCbe"
$ ruby1.9 -e 'require "yaml"; puts "Rübe".to_yaml'
--- "R\xC3\xBCbe"
}}}
seems to work now! Macruby escpapes to UTF-16 and Ruby1.9 escapes to
UTF-8.
Actually, it seems to me (though I'm willing to be corrected on
this), that the ruby1.9 encoding is simply wrong: It translates the
accented character into UTF-8, and then escapes the two UTF-8
characters separately. What this ends up encoding is "Rübe", which
is not what you want.
I didn't find anything in YAML docs that describes that behaviour,
both methods seem to be correct.
They can't possibly be BOTH correct, as interpreting the output of
one according to the theory of the other would give a different
result. If you look at the section in the YAML spec: , you will see
[57] "Escaped 8-bit Unicode character."
This is NOT an UTF-8 character.
But ruby 1.8 fails to load the UTF-16 YAML. That is not astonishing
because IMHO there is now way to guess what is the correct escaping
mode.
It's not astonishing because (a) 1.8 has very poor Unicode support
anyway and (b) this would hardly be the only bug in syck.
OK, you are right!
When I started generating a YAML in macruby and importing it to ruby
1.8 I haven't done anything with Unicode, so I am not very experienced
yet.
I think escaping is not necessary here because the encoding of
input and
output is the same. This can easly be tested by
{{{
$ macruby -e 'require "yaml"; puts YAML::load "--- Rübe"'
Rübe
}}}
That's an interesting point. I think you're right that the YAML spec
does not require escaping of printable characters >\u007F. However,
non-printable characters DO have to be escaped, and for the
printable ones, it could be argued that erring on the side of
escaping helps readability if the OS does not have font coverage for
some printable characters. In any case, the current implementation
tries to be conservative in what it generates and liberal in what it
accepts. I'm open to persuasion that we should avoid escaping
characters, provided there is a low-cost test for printability of
general Unicode characters (I have not yet checked whether one of
the built-in CFCharacterSets can give that; the descriptions were
inconclusive).
The YAML spec, Chapter 5.1 Character Sets says:
> "To ensure readability, YAML streams use only the printable subset
of the Unicode character set"
> [1] c-printable ::= #x9 | #xA | #xD | [#x20-#x7E] /* 8
bit */
> | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] /* 16 bit */
> | [#x1-#x10] /* 32 bit */
Only characters that are not "c-printable" MUST be escaped and this is
well defined. (For Strings you have to add the " and the \ as special
characters).
> "...In addition, any allowed characters known to be non-printable
SHOULD also be escaped.
> This isn’t mandatory since a full implementation would require
extensive character property tables."
So it is a SHOULD and not a MUST because it is too expensive. The YAML
spec is a little bit confusing with "allowed characters" and "non
printing characters".
Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Should the HotCocoa example on the home page run on 0.5 beta 2?
I found the same error yesterday while debugging one of my broken HotCocoa Apps.
Am 19.12.2009 um 07:10 schrieb Jeremy Voorhis:
> I've just installed the latest MacRuby beta binaries on my new macbook, and
> this happens:
>
> Jeremy-Voorhiss-MacBook-Pro:~ jvoorhis$ cat test.rb
> require 'hotcocoa'
> include HotCocoa
> application do |app|
> win = window :size => [100,50]
> b = button :title => 'Hello'
> b.on_action { puts 'World!' }
> win << b
> end
> Jeremy-Voorhiss-MacBook-Pro:~ jvoorhis$ macruby --version
> MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]
> Jeremy-Voorhiss-MacBook-Pro:~ jvoorhis$ macruby test.rb
> 2009-12-18 22:06:45.181 macruby[76926:903] *** -[NSLock unlock]: lock
> ( '(null)') unlocked when not locked
> 2009-12-18 22:06:45.184 macruby[76926:903] *** Break on _NSLockError() to
> debug.
> /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/1.9.0/hotcocoa/mappings/application.rb:9:in
> `handle_block:': undefined method `on_action' for 0:NSButton (NoMethodError)
> from core:in `application:'
> from test.rb:2:in `'
>
> I've hardly used HotCocoa at all. This might have already been covered in
> some other thread that I wasn't paying attention to. If not, I can file
> something in trac.
>
> Thanks,
>
> Jeremy
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] macruby in automator shell
Hi, sometimes it´s fun „programming“ a workflow or a service with the automator (and some times not). Because there is no macruby cmd in the shell script section, I wrote this install script: # file: automator-macruby.rb # # extend the automator shell script configuration # by simply copying the ruby configuration to macruby # (must be executed with sudo) AUTOMATOR_SHELL_CONFIG = "/System/Library/Automator/Run Shell Script.action/Contents/Resources/Shells.plist" shell_config = NSDictionary.dictionaryWithContentsOfFile AUTOMATOR_SHELL_CONFIG raise "automator shell config file: not found" if shell_config.nil? ruby_path = `which ruby`.strip ruby_config = shell_config[ruby_path] raise "ruby configuration: not found" if ruby_config.nil? macruby_path = `which macruby`.strip shell_config[macruby_path] = ruby_config ok = shell_config.writeToFile(AUTOMATOR_SHELL_CONFIG, atomically:false) raise "automator shell config file: write error" if ok == 0 ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] 0.6 almost there, need help!
My apps are working too! Unfortunately compiling to static code is broken: $ cat a.rb puts 42 $ macrubyc --static a.rb Undefined symbols: "llvm::ExecutionEngine::createJIT(llvm::ModuleProvider*, std::basic_string, std::allocator >*, llvm::JITMemoryManager*, llvm::CodeGenOpt::Level, bool, llvm::CodeModel::Model)", referenced from: RoxorCore::RoxorCore()in libmacruby-static.a(vm.o) "llvm::MetadataContext::getMDKind(llvm::StringRef) const", referenced from: RoxorCompiler::RoxorCompiler(bool)in libmacruby-static.a(compiler.o) "llvm::Instruction::clone() const", referenced from: RoxorCompiler::compile_slot_cache(unsigned long)in libmacruby-static.a(compiler.o) RoxorCompiler::compile_ivar_slots(llvm::Value*, llvm::iplist >&, llvm::ilist_iterator)in libmacruby-static.a(compiler.o) "llvm::Module::getOrInsertFunction(llvm::StringRef, llvm::FunctionType const*)", referenced from: [……...] RoxorCompiler::compile_constant_declaration(RNode*, llvm::Value*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_defined_expression(RNode*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) in libmacruby-static.a(compiler.o) RoxorCompiler::compile_scope(RNode*) in libmacruby-static.a(compiler.o) ld: symbol(s) not found collect2: ld returned 1 exit status Error when executing `/usr/bin/g++ -o "a.out" -arch x86_64 -L/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib -lmacruby-static -L/usr/local/lib -lpthread -lffi -lm -lLLVMBitWriter -lLLVMX86CodeGen -lLLVMX86Info -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem -lpthread -ldl -lxml2 -lobjc -lauto -licucore -framework Foundation "/var/folders/h8/h8LyJnqpHJmC4vtkCPXgCE+++TI/-Tmp-/main-81995.o" "./a.o"' - Bernd Am 23.04.2010 um 07:50 schrieb Matt Aimonetti: > For the record, the two MacRuby apps I use daily run perfectly under 0.6trunk. > > - Matt > > On Thu, Apr 22, 2010 at 10:31 PM, Laurent Sansonetti > wrote: > Now: > > http://www.macruby.org/trac/ticket/628 CTFramesetterCreateFrame doesn't like > the CFRange type > http://www.macruby.org/trac/ticket/662 macruby 0.6 breaks Grow > > Laurent > > On Apr 21, 2010, at 3:40 PM, Laurent Sansonetti wrote: > > > After fixing + triaging more bugs, we selected: > > > > http://www.macruby.org/trac/ticket/628 CTFramesetterCreateFrame doesn't > > like the CFRange type > > http://www.macruby.org/trac/ticket/656 NSCoder encodeFloat and > > decodeFloatForKey doesn't with ruby float > > http://www.macruby.org/trac/ticket/662 macruby 0.6 breaks Growl > > http://www.macruby.org/trac/ticket/658 Including a module into Hash breaks > > creating an NSDictionary from a hash > > http://www.macruby.org/trac/ticket/594 Not all methods visible to > > objective-c calls > > http://www.macruby.org/trac/ticket/540 segfault with NSURLDownload with GC > > on > > http://www.macruby.org/trac/ticket/551 NSThread.alloc.initWithTarget > > segfaulting > > http://www.macruby.org/trac/ticket/550 TypeError: unrecognized runtime type > > when using NSThread.alloc.initWithTarget > > http://www.macruby.org/trac/ticket/552 NSOperationQueue segfaults when more > > than one operation is being added > > > > Laurent > > > > On Apr 15, 2010, at 8:11 PM, Laurent Sansonetti wrote: > > > >> Thank you :-) > >> > >> I did a quick pass and noted the following bugs already: > >> > >> https://www.macruby.org/trac/ticket/458 > >> https://www.macruby.org/trac/ticket/629 > >> https://www.macruby.org/trac/ticket/507 > >> https://www.macruby.org/trac/ticket/628 > >> > >> Laurent > >> > >> On Apr 15, 2010, at 7:47 PM, robert gleeson wrote: > >> > >>> Laurent, > >>> > >>> Hey, awesome work! I'll check out the nightly later today/tomorrow for > >>> me. I think I've reported a few bugs so I'll check it out and report back > >>> to you :-P > >>> > >>> Thanks, > >>> Rob > >>> > >>> On 16 Apr 2010, at 03:39, Laurent Sansonetti wrote: > >>> > Hi guys, > > 0.6 is now almost there. I need to polish a few more things and prepare > a detailed blog post about what changed. A lot of things changed in > fact, it's going to take some time :-) > > For this release, we would like to announce that MacRuby is now stable > for Cocoa development. If you are working on a MacRuby Cocoa app, it > would be awesome if you could try the latest nightly build (or build the > sources by yourself)
Re: [MacRuby-devel] 0.6 almost there, need help!
Hi! > Looks like the version of LLVM that you installed in your system is too old. > Are you using MacRuby from the nightly builds? It could explain the problem > then (and if you manually built MacRuby in the past). You are right, LLVM is an elder version I used compiling MacRuby 0.5. Now i am using the nightly builds... > > --static only works if you installed LLVM manually. Ooops, that’s new for me! > This is a problem that we should fix in 0.6… +1 Bernd > > Laurent > > On Apr 23, 2010, at 4:18 AM, B. Ohr wrote: > >> My apps are working too! >> >> Unfortunately compiling to static code is broken: >> >> $ cat a.rb >> puts 42 >> $ macrubyc --static a.rb >> Undefined symbols: >> "llvm::ExecutionEngine::createJIT(llvm::ModuleProvider*, >> std::basic_string, std::allocator >*, >> llvm::JITMemoryManager*, llvm::CodeGenOpt::Level, bool, >> llvm::CodeModel::Model)", referenced from: >> RoxorCore::RoxorCore()in libmacruby-static.a(vm.o) >> "llvm::MetadataContext::getMDKind(llvm::StringRef) const", referenced from: >> RoxorCompiler::RoxorCompiler(bool)in libmacruby-static.a(compiler.o) >> "llvm::Instruction::clone() const", referenced from: >> RoxorCompiler::compile_slot_cache(unsigned long)in >> libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_ivar_slots(llvm::Value*, >> llvm::iplist >&, >> llvm::ilist_iterator)in libmacruby-static.a(compiler.o) >> "llvm::Module::getOrInsertFunction(llvm::StringRef, llvm::FunctionType >> const*)", referenced from: >> [……...] >> RoxorCompiler::compile_constant_declaration(RNode*, llvm::Value*) >> in libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_defined_expression(RNode*) in >> libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) >> in libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) >> in libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) >> in libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_multiple_assignment(RNode*, llvm::Value*) >> in libmacruby-static.a(compiler.o) >> RoxorCompiler::compile_scope(RNode*) in >> libmacruby-static.a(compiler.o) >> ld: symbol(s) not found >> collect2: ld returned 1 exit status >> Error when executing `/usr/bin/g++ -o "a.out" -arch x86_64 >> -L/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib >> -lmacruby-static -L/usr/local/lib -lpthread -lffi -lm -lLLVMBitWriter >> -lLLVMX86CodeGen -lLLVMX86Info -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMJIT >> -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils >> -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport >> -lLLVMSystem -lpthread -ldl -lxml2 -lobjc -lauto -licucore -framework >> Foundation "/var/folders/h8/h8LyJnqpHJmC4vtkCPXgCE+++TI/-Tmp-/main-81995.o" >> "./a.o"' >> >> - Bernd >> >> Am 23.04.2010 um 07:50 schrieb Matt Aimonetti: >> >>> For the record, the two MacRuby apps I use daily run perfectly under >>> 0.6trunk. >>> >>> - Matt >>> >>> On Thu, Apr 22, 2010 at 10:31 PM, Laurent Sansonetti >>> wrote: >>> Now: >>> >>> http://www.macruby.org/trac/ticket/628 CTFramesetterCreateFrame doesn't >>> like the CFRange type >>> http://www.macruby.org/trac/ticket/662 macruby 0.6 breaks Grow >>> >>> Laurent >>> >>> On Apr 21, 2010, at 3:40 PM, Laurent Sansonetti wrote: >>> >>> > After fixing + triaging more bugs, we selected: >>> > >>> > http://www.macruby.org/trac/ticket/628 CTFramesetterCreateFrame doesn't >>> > like the CFRange type >>> > http://www.macruby.org/trac/ticket/656 NSCoder encodeFloat and >>> > decodeFloatForKey doesn't with ruby float >>> > http://www.macruby.org/trac/ticket/662 macruby 0.6 breaks Growl >>> > http://www.macruby.org/trac/ticket/658 Including a module into Hash >>> > breaks creating an NSDictionary from a hash >>> > http://www.macruby.org/trac/ticket/594 Not all methods visible to >>> > objective-c calls >>> > http://www.macruby.org/trac/ticket/540 segfault with NSURLDownload with >>> > GC on >>> > http://www.mac
Re: [MacRuby-devel] [ANN] MacRuby 0.6
Hi Laurent, many thanks for the new version! if I might express a wish, then this: MacRuby on the iPhone (or iPad) - Simulator (yes, the Simulator, not the iPhone itself) for the quick checkout of ideas, however, also learning around the frameworks. Prototyping in ObjC is the hell, at least for me! One could solve the problem of the missing GC, nevertheless, simply with an alloc of memory what never becomes deallocated. Could such a thing be possible? Bernd Am 03.05.2010 um 23:28 schrieb Laurent Sansonetti: > Hi, > > After 3 months of development since the last release, MacRuby 0.6 is > now available. Get it here while it's still hot! > > MacRuby is an implementation of Ruby 1.9 directly on top of Mac OS X > core technologies such as the Objective-C runtime and garbage > collector, the LLVM compiler infrastructure and the Foundation and ICU > frameworks. It is the goal of MacRuby to enable the creation of > full-fledged Mac OS X applications which do not sacrifice performance > in order to enjoy the benefits of using Ruby. > > You can learn more about MacRuby, and download a binary installer, > from the website: > > http://macruby.org > > Or about this release more specifically, on our blog: > > http://www.macruby.org/blog/2010/04/30/macruby06.html > > Enjoy, > > Laurent > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [ANN] MacRuby 0.6
Matt, this is already aware to me, I also do not know the planning of MacRuby (this point disappeared from the website) just as little I the intentions of Apple knows. If you read up once again, I have wished not from Laurent that he implements it, but I wanted to know whether this is possible to implement with a dead simple (non-GC-)memory allocation. Bernd Am 04.05.2010 um 18:52 schrieb Matt Aimonetti: > Bernrd, > > I can't speak for Laurent or Apple, but I think that even though I would also > love to be able to prototype iP* apps in MacRuby, there are plenty of other > things that have a higher priority. However, I'm sure that if the community > gets organized, that feature can be added without the direct involvement of > Laurent or other Apple's employees working on the project. > > - Matt > > On Tue, May 4, 2010 at 8:43 AM, B. Ohr wrote: > Hi Laurent, > > many thanks for the new version! > > if I might express a wish, then this: > > MacRuby on the iPhone (or iPad) - Simulator (yes, the Simulator, not the > iPhone itself) > > for the quick checkout of ideas, however, also learning around the > frameworks. Prototyping in ObjC is the hell, at least for me! > > One could solve the problem of the missing GC, nevertheless, simply with an > alloc of memory what never becomes deallocated. > > Could such a thing be possible? > > Bernd > > > > > Am 03.05.2010 um 23:28 schrieb Laurent Sansonetti: > >> Hi, >> >> After 3 months of development since the last release, MacRuby 0.6 is >> now available. Get it here while it's still hot! >> >> MacRuby is an implementation of Ruby 1.9 directly on top of Mac OS X >> core technologies such as the Objective-C runtime and garbage >> collector, the LLVM compiler infrastructure and the Foundation and ICU >> frameworks. It is the goal of MacRuby to enable the creation of >> full-fledged Mac OS X applications which do not sacrifice performance >> in order to enjoy the benefits of using Ruby. >> >> You can learn more about MacRuby, and download a binary installer, >> from the website: >> >> http://macruby.org >> >> Or about this release more specifically, on our blog: >> >> http://www.macruby.org/blog/2010/04/30/macruby06.html >> >> Enjoy, >> >> Laurent >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] NSObject.to_s question
Jordan,
you can do something like that:
class Object
alias :old_inspect :inspect
def inspect
i = old_inspect
if i.start_with?('#<')
d = description
d.start_with?('<') ? i : d
else
i
end
end
end
But you’re right, a better integration of „description“ would be nice.
Bernd
Am 05.05.2010 um 22:30 schrieb Jordan Breeding:
> Right now for custom objects on the Objective-C side even if you provide a
> -[Object description] call to_s will fall through and hit to_s from NSObject
> which right now just has the class name and pointer.
>
> Is it already planned for the future to use the description method in to_s on
> the MacRuby side? Should I file a bug report?
>
> Jordan___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] v0.7 and v0.6 timeout problem
Hi, I have strange timeout problems with 0.6 and 0.7 $ time macruby_select 0.7 -e 'framework "Cocoa"' 2010-05-06 07:03:55.018 macruby[1922:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real0m1.588s user0m0.699s sys 0m0.096s 0.6 takes even longer: $ time macruby_select 0.6 -e 'framework "Cocoa"' 2010-05-06 07:03:43.672 macruby[1913:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real0m2.170s user0m0.698s sys 0m0.102s while 0.5 has no timeout: $ time macruby_select 0.5 -e 'framework "Cocoa“‘ real0m0.398s user0m0.380s sys 0m0.057s I’m still on OS X Version 10.6.2, is that the reason? In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that did’nt help. - Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] v0.7 and v0.6 timeout problem
Hi, thanks, after the reboot (not stupid!) the problem disappeared! Very interesting, I didn’t expected that because 0.5 had no problems. Maybe that happened because 0.7 is still slower than 0.5: $ time macruby_select 0.7 -e 'framework "Cocoa“‘ real0m0.626s user0m0.665s sys 0m0.085s $ time macruby_select 0.5 -e 'framework "Cocoa“‘ real0m0.385s user0m0.378s sys 0m0.053s - Bernd Am 07.05.2010 um 00:25 schrieb Thibault Martin-Lagardette: > Hi! > > I cannot really reproduce this unfortunately, but I would have a couple of > questions: > - That might be stupid, but did you try rebooting? > - What language are you using on your system? > - Did you ever try to "shrink" applications by getting rid of different > languages? > > Thanks :-) > > -- > Thibault Martin-Lagardette > > > > On May 5, 2010, at 22:10, B. Ohr wrote: > >> Hi, I have strange timeout problems with 0.6 and 0.7 >> >> $ time macruby_select 0.7 -e 'framework "Cocoa"' >> 2010-05-06 07:03:55.018 macruby[1922:607] >> __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to >> pbs >> real 0m1.588s >> user 0m0.699s >> sys 0m0.096s >> >> 0.6 takes even longer: >> >> $ time macruby_select 0.6 -e 'framework "Cocoa"' >> 2010-05-06 07:03:43.672 macruby[1913:607] >> __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to >> pbs >> real 0m2.170s >> user 0m0.698s >> sys 0m0.102s >> >> while 0.5 has no timeout: >> >> $ time macruby_select 0.5 -e 'framework "Cocoa“‘ >> real 0m0.398s >> user 0m0.380s >> sys 0m0.057s >> >> I’m still on OS X Version 10.6.2, is that the reason? >> >> In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that >> did’nt help. >> >> - Bernd >> >> >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] 0.7 problems with complex index in a hash
Hi,
v0.7 has a different behavior than v0.5 when using a Cocoa-Obj (NSCalendarDate)
as a key in a hash.
I must admit that I do not know what is exactly specified in Ruby, but
obviously the generated value of an hashkey of different objects is same in all
other cases if the objects itself are identical:
- Bernd
---
$ macruby_select 0.7 h.rb
{#=>:x, #=>:y}#
< is this ok
{["t", "e", "s", "t"]=>:y}
{#=>:y}
$ macruby_select 0.5 h.rb
{#=>:y}
{["t", "e", "s", "t"]=>:y}
{#=>:y}
$ ruby h.rb
{["t", "e", "s", "t"]=>:y}
{#=>:y}
$ ruby1.9 h.rb
{["t", "e", "s", "t"]=>:y}
{#=>:y}
$ cat h.rb
require 'Date'
def h(d1,d2)
h = { d1 => :x}
h[d2] = :y
p h
end
d1 = NSCalendarDate.dateWithYear( 2010, month:5, day:2, hour:0, minute:0,
second:0, timeZone:nil)
d2 = NSCalendarDate.dateWithYear( 2010, month:5, day:2, hour:0, minute:0,
second:0, timeZone:nil)
h(d1,d2)
h( ["t", "e", "s", "t"],"test".chars.to_a)
h( Date.parse("2010-02-01"), Date.parse("2010-02-01“))
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] KVC: different behaviour with set and =
I have a binding of an user interface element to my controller (Controller.self.test): The setTest does work, but the 'test =' does not. class Controller < NSWindowController attr_accessor :test def works setTest true end def doesnotwork test = true end end Is this a bug? - Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] KVC: different behaviour with set and =
Hi! Oh sorry, my first message was a little bit too short. In the IB I created a button and on the bindings pane I connected the hidden property to Controller, the ‚Model Key Path‘ is set to 'Controller.self.test‘. Now when I am calling ‚work‘ the button gets hidden, but with ‚doesnotwork‘ the button remains visible. There seems to be no notification. - Bernd Am 17.05.2010 um 10:00 schrieb Thibault Martin-Lagardette: > Hi ! > > What exactly is not working? You said you have "Controller.self.test", what > do you mean by that? > Both setX and X= work for me, here is what I get: > > $> cat t.rb > class A >attr_accessor :someAttr > end > > a = A.new > a.setSomeAttr "set via #setSomeAttr" > p a.someAttr > a.someAttr = "set via #someAttr=" > p a.someAttr > > $> macruby t.rb > "set via #setSomeAttr" > "set via #someAttr=" > > -- > Thibault Martin-Lagardette > > > > On May 17, 2010, at 00:47, B. Ohr wrote: > >> >> I have a binding of an user interface element to my controller >> (Controller.self.test): The setTest does work, but the 'test =' does not. >> >> class Controller < NSWindowController >> attr_accessor :test >> >> def works >> setTest true >> end >> >> def doesnotwork >> test = true >> end >> >> end >> >> Is this a bug? >> >> - Bernd >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] KVC: different behaviour with set and =
Ooops, shame on me, you are right. Now it is working…. Am 17.05.2010 um 10:20 schrieb Vincent Isambart: >> class Controller < NSWindowController >> attr_accessor :test >> def works >>setTest true >> end >> def doesnotwork >>test = true >> end >> end > > "test = true" should be "self.test = true" > "test = true" just creates a local variable named test. > It's a very common mistake in Ruby. > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] some gcd issues
Hi Ernest,
Am 04.06.2010 um 19:03 schrieb Ernest N. Prabhakar, Ph.D.:
> Hmm, you should NOT need to call "group" on the @job for normal usage.
>
> Could you just use "@job.join" to get the behavior you want?
>
Thanks, I am using join now!
Unfortunately join is crashing too with the main queue
(Dispatch::Queue.concurrent is working):
$ macruby -r dispatch -e 'Dispatch::Job.new {sleep
1}.join(Dispatch::Queue.main) {puts "!"}'
/Library/Frameworks/MacRuby.framework/Versions/0.7/usr/lib/ruby/1.9.0/dispatch/job.rb:29:in
`join:': expected Queue object, but got Dispatch::Queue (ArgumentError)
from /Developer/Examples/Ruby/MacRuby/Scripts/-e:1:in `’
- Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] has anyone played with audio frameworks?
I’m thinking a long time about doing my own audio app, but the missing Obj-C framework stopped me every time. Somebody said, that the Obj-C method dispatching is too slow for real time audio. But now, according to Gruber (Daring Fireball) there seems to be a new upcoming framework (AV Foundation): http://daringfireball.net/2010/06/wwdc_wrapup Maybe it is something like this: http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVFoundationFramework/AVFoundationFramework.pdf I think, I will wait for that! :-) - Bernd Am 29.05.2010 um 09:29 schrieb Rich Morin: > I'm interested in playing with the OSX audio frameworks; I > thought I should find out if anyone here has any experience > that might be relevant. > > -r > -- > http://www.cfcl.com/rdmRich Morin > http://www.cfcl.com/rdm/resume [email protected] > http://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, system design > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Compilation Clarification
Hi!
>
> In the upcoming 0.7 release static compilation will be permitted, you will be
> able to generate a standalone binary that contains both the MacRuby runtime
> (some features disabled) and your application code, in about 1.5MB for
> regular-size apps.
>
I tested that and it is looking great: only 1379704 bytes for my small app!
That size makes MacRuby really useable for Quicklook and Spotlight plugins. But
what about garbage collection?
If Macruby.sharedRuntime.evaluateString could use memory of an enclosing
NSAutoreleasePool it would be very easy:
OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef
preview,
CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options)
{
if (QLPreviewRequestIsCancelled(preview))
return noErr;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
…;
NSMutableString* html = [[MacRuby sharedRuntime] evaluateString ….];
QLPreviewRequestSetDataRepresentation(preview,
(CFDataRef)[html dataUsingEncoding:NSUTF8StringEncoding],
kUTTypeHTML, (CFDictionaryRef)props);
[pool release];
return noErr;
}
- Bernd
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] [MacRuby] #821: uncached ObjC stub - Abort trap
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)
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] MacRuby and the UIKit framework for Mac OS X
Hi, I ported a small demo the UIKit framework for Mac OS X (http://chameleonproject.org/) to MacRuby. Although the framework is not currently known to be GC-safe it is working for me: https://gist.github.com/884875 I will do further investigations in this topic because I want to learn UIKit and playing around with MacRuby is much faster than with Obj-C. Bernd ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] MacRuby and the UIKit framework for Mac OS X
Thanks, it is working now after generating the BridgeSupport file! I changed the gist. Am 24.03.2011 um 13:36 schrieb Eloy Durán: > Just a quick FYI, constants are missing because you need to generate a > BridgeSupport file for the framework that retrieves these names/values from > the headers. See `man gen_bridge_metadata` for more info. > > On Mar 24, 2011, at 12:09 PM, B. Ohr wrote: > >> Hi, >> >> I ported a small demo the UIKit framework for Mac OS X >> (http://chameleonproject.org/) to MacRuby. Although the framework is not >> currently known to be GC-safe it is working for me: >> >> https://gist.github.com/884875 >> >> I will do further investigations in this topic because I want to learn UIKit >> and playing around with MacRuby is much faster than with Obj-C. >> >> Bernd >> ___ >> MacRuby-devel mailing list >> [email protected] >> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] MacRuby & MountainLion + what you can do to help the project
> > ……. Or maybe we can just agree to only support the latest Xcode version > (thoughts?) Oh, please do not! I am still running snow leopard and Xcode 4.2! ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] How can I catch segment faults?
Hey, after installing r2590 with backtrace support (thanks for that!) now I have the problem to catch segment faults. It seems to be a problem inside of a hash#each_pair, but I have absolutely no idea where, and because it is foreign code a file name and line number would be more than useful! --- (gdb) run ../xx.rb compile Starting program: /usr/local/bin/macruby ../xx.rb compile Reading symbols for shared libraries + done Loading site data... Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x7fff60771b60 0x000100d90283 in _cache_getMethod () (gdb) backtrace #0 0x000100d90283 in _cache_getMethod () #1 0x000100d8fa43 in look_up_method () #2 0x000100176c4d in __rb_vm_dispatch [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm.cpp:2780 #3 0x000100176c4d in rb_vm_dispatch (cache=0x108fcfac0, self=140734799741824, sel=0x102b8b570, block=0x0, opt=0 '\0', argc=1) at vm.cpp:3154 #4 0x000104152605 in ?? () #5 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm.cpp:4207 #6 0x0001001752b6 in rb_vm_yield (argc=6687904, argv=0x7fff5fbf56f0) at vm.cpp:4214 #7 0x00010011a978 in rb_yield_0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm_eval.c:194 #8 0x00010011a978 in rb_yield_values (n=unavailable, due to optimizations>) at vm_eval.c:226 #9 0x000100039c68 in inject_i (i=1, p=140734799741792, argc=6753408, argv=0x7fff5fbf5988) at enum.c:429 #10 0x0001001741da in rb_vm_block_eval0 (b=0x2006403c0, sel=0x0, self=8596725184, argc=1, argv=0x10a64a860) at vm.cpp:4082 #11 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm.cpp:4207 #12 0x0001001752b6 in rb_vm_yield (argc=1, argv=0x7fff5fbf5988) at vm.cpp:4214 #13 0x00010011a1f0 in rb_yield (val=8596688000) at vm_eval.c:194 #14 0x00010004d5f7 in each_pair_i (key=8596688000, value=0) at hash.c:1099 #15 0x000100050c2c in rb_hash_foreach (hash=unavailable, due to optimizations>, func=0x10004d5e0 , farg=0) at hash.c:108 #16 0x000100051321 in rb_hash_each_pair (hash=8596722368, sel=0x102b2b400) at hash.c:1125 #17 0x0001001738e1 in rb_vm_call_with_cache2 (cache=0x102b2b490, block=0x2006403c0, self=8596722368, klass=4295299792, sel=0x102b2b400, argc=, argv=0x0) at vm.cpp:2336 #18 0x000100037fd8 in enum_inject (obj=8596722368, sel=temporarily unavailable, due to optimizations>, argc=temporarily unavailable, due to optimizations>, argv=temporarily unavailable, due to optimizations>) at enum.c:521 #19 0x000100177be1 in rb_vm_dispatch (cache=0x106e620b0, self=8596722368, sel=0x102b51b30, block=0x200640420, opt=2 '\002', argc=1) at vm.cpp:2679 #20 0x000104152410 in ?? () #21 0x000104151afe in ?? () #22 0x00010415173b in ?? () #23 0x00010006cbe7 in rb_class_new_instance_imp (klass=1, sel=, argc=6755200, argv=0x104152390) at object.c:1892 #24 0x000100177be1 in rb_vm_dispatch (cache=0x102b69670, self=8596901376, sel=0x102b2d8b0, block=0x0, opt=0 '\0', argc=1) at vm.cpp:2679 #25 0x00010414fe2f in ?? () #26 0x00010414f785 in ?? () #27 0x00010413812e in ?? () #28 0x00010414c561 in ?? () #29 0x0001040808f2 in ?? () #30 0x00010003f809 in ruby_run_node (n=0x200662500) at eval.c:198 #31 0x00010dd8 in main (argc=3, argv=0x102b1ba90, envp=temporarily unavailable, due to optimizations>) at main.cpp:42 ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] How can I catch segment faults?
Hi Laurent, thank you for your tips. However, with the GC the problem has nothing to do. miniruby I cannot use, because with it YAML does not function. In the end, I have applied the following trick: (gdb) break rb_class_new_instance_imp (gdb) run ../xx.rb compile (gdb) cont 12 (gdb) jump rb_memerror an I got a wonderful backtrace with file names (line numbers). Then it was relatively simply to be isolated the problem for which I have generated ticket #344. Bernd Am 20.09.2009 um 21:47 schrieb Laurent Sansonetti: Hi, We will implement dwarf symbolication which will allow you to see the ruby method, filename and line instead of ?? in the gdb backtrace, but in the meantime an easy way to debug these problems is to toggle the ROXOR_VM_DEBUG variable to 1 in vm.cpp and recompile miniruby. This will print a lot of information on stdout, which should allow you to track and identify the crash. # Segmentation faults are bugs in MacRuby core, so in theory users should not see them :) Also, try setting the GC_DISABLE environment variable to 1 before starting the program, if it doesn't crash then it's very likely a missing write barrier in the collector. Laurent On Sep 20, 2009, at 3:03 AM, B. Ohr (dev) wrote: Hey, after installing r2590 with backtrace support (thanks for that!) now I have the problem to catch segment faults. It seems to be a problem inside of a hash#each_pair, but I have absolutely no idea where, and because it is foreign code a file name and line number would be more than useful! --- (gdb) run ../xx.rb compile Starting program: /usr/local/bin/macruby ../xx.rb compile Reading symbols for shared libraries + done Loading site data... Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x7fff60771b60 0x000100d90283 in _cache_getMethod () (gdb) backtrace #0 0x000100d90283 in _cache_getMethod () #1 0x000100d8fa43 in look_up_method () #2 0x000100176c4d in __rb_vm_dispatch [inlined] () at /Users/ box/Documents/dev/macruby/macruby/vm.cpp:2780 #3 0x000100176c4d in rb_vm_dispatch (cache=0x108fcfac0, self=140734799741824, sel=0x102b8b570, block=0x0, opt=0 '\0', argc=1) at vm.cpp:3154 #4 0x000104152605 in ?? () #5 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm.cpp:4207 #6 0x0001001752b6 in rb_vm_yield (argc=6687904, argv=0x7fff5fbf56f0) at vm.cpp:4214 #7 0x00010011a978 in rb_yield_0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm_eval.c:194 #8 0x00010011a978 in rb_yield_values (n=unavailable, due to optimizations>) at vm_eval.c:226 #9 0x000100039c68 in inject_i (i=1, p=140734799741792, argc=6753408, argv=0x7fff5fbf5988) at enum.c:429 #10 0x0001001741da in rb_vm_block_eval0 (b=0x2006403c0, sel=0x0, self=8596725184, argc=1, argv=0x10a64a860) at vm.cpp:4082 #11 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ Documents/dev/macruby/macruby/vm.cpp:4207 #12 0x0001001752b6 in rb_vm_yield (argc=1, argv=0x7fff5fbf5988) at vm.cpp:4214 #13 0x00010011a1f0 in rb_yield (val=8596688000) at vm_eval.c:194 #14 0x00010004d5f7 in each_pair_i (key=8596688000, value=0) at hash.c:1099 #15 0x000100050c2c in rb_hash_foreach (hash=unavailable, due to optimizations>, func=0x10004d5e0 , farg=0) at hash.c:108 #16 0x000100051321 in rb_hash_each_pair (hash=8596722368, sel=0x102b2b400) at hash.c:1125 #17 0x0001001738e1 in rb_vm_call_with_cache2 (cache=0x102b2b490, block=0x2006403c0, self=8596722368, klass=4295299792, sel=0x102b2b400, argc=unavailable, due to optimizations>, argv=0x0) at vm.cpp:2336 #18 0x000100037fd8 in enum_inject (obj=8596722368, sel=temporarily unavailable, due to optimizations>, argc=temporarily unavailable, due to optimizations>, argv=temporarily unavailable, due to optimizations>) at enum.c:521 #19 0x000100177be1 in rb_vm_dispatch (cache=0x106e620b0, self=8596722368, sel=0x102b51b30, block=0x200640420, opt=2 '\002', argc=1) at vm.cpp:2679 #20 0x000104152410 in ?? () #21 0x000104151afe in ?? () #22 0x00010415173b in ?? () #23 0x00010006cbe7 in rb_class_new_instance_imp (klass=1, sel=, argc=6755200, argv=0x104152390) at object.c:1892 #24 0x000100177be1 in rb_vm_dispatch (cache=0x102b69670, self=8596901376, sel=0x102b2d8b0, block=0x0, opt=0 '\0', argc=1) at vm.cpp:2679 #25 0x00010414fe2f in ?? () #26 0x00010414f785 in ?? () #27 0x00010413812e in ?? () #28 0x00010414c561 in ?? () #29 0x0001040808f2 in ?? () #30 0x00010003f809 in ruby_run_node (n=0x200662500) at eval.c:198 #31 0x00010dd8 in main (argc=3, argv=0x102b1ba90, envp=) at main.cpp:42 ___ MacRuby-devel mailing list [email protected] http
[MacRuby-devel] What is the status of autoload?
Hi, autoload is not working: $ macruby -e 'autoload :YAML, "yaml"; p YAML' core:in `const_missing:': uninitialized constant YAML (NameError) from -e:1:in `' I saw some tags about this so I am asking before I open a ticket... ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
