Re: [MacRuby-devel] MacRuby solutions to the exercises in Aaron Hillegass's "Cocoa Programming for Mac OS X, 3rd edition"

2010-10-10 Thread Caio Chassot
On 2010-10-04, at 03:29 , Caio Chassot wrote: > > I wrote these today: http://github.com/kch/macruby-programming-cocoa Updated that. Now done up to chapter 19. ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 17:23 , Laurent Sansonetti wrote: > > You seem to have found a bug in the parser :) It seems I'm getting good at it ;) > Could you file that as a ticket? https://www.macruby.org/trac/ticket/950 ___ MacRuby-devel mailing list MacRub

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 17:24 , Laurent Sansonetti wrote: > > Indeed, +initialize won't be called for pure-Ruby classes. I recommend to use > the Ruby idiom here, it's simpler :) So, the problem I'm seeing is what I alluded to earlier: writing stuff in the class body is more like +load than +initiali

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Laurent Sansonetti
Hi Caio, On Oct 10, 2010, at 9:35 AM, Caio Chassot wrote: > Hi, > > It looks like self.initialize is a no-go: > >class Foo > def self.initialize >NSLog("self.initialize is a sd panda") # <- never runs > end >end > > > The ruby idiom for that would be just: > >

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Laurent Sansonetti
Hi Caio, You seem to have found a bug in the parser :) Could you file that as a ticket? Thanks, Laurent On Oct 10, 2010, at 11:46 AM, Caio Chassot wrote: > I'm playing again with implementing the Hillegass book in MacRuby, and ran > across this method: > >+ (NSAlert *)alertWithMessageText

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 15:53 , Caius Durling wrote: > >> Now, the interesting part here is the ", ..." at the end. It takes variable >> arguments at the end that work as formatting arguments for informativeText, >> eg. sprintf(informativeText, ...). > > Does it work if you pass an array in as the la

Re: [MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caius Durling
On 10 Oct 2010, at 19:46, Caio Chassot wrote: > I'm playing again with implementing the Hillegass book in MacRuby, and ran > across this method: > >+ (NSAlert *)alertWithMessageText:(NSString *)messageTitle >defaultButton:(NSString *)defaultButtonTitle >

[MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

2010-10-10 Thread Caio Chassot
I'm playing again with implementing the Hillegass book in MacRuby, and ran across this method: + (NSAlert *)alertWithMessageText:(NSString *)messageTitle defaultButton:(NSString *)defaultButtonTitle alternateButton:(NSString *)alternateButtonTitle

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 15:15 , Matt Aimonetti wrote: > > The problem in your example is that in Ruby, the constructor is an instance > method, not a class method. > So your mistake was to define self.initialize instead of just initialize. I'm afraid you misunderstood my question. I'm not talking abou

Re: [MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Matt Aimonetti
$ macruby -e "class Foo; def initialize; puts '10/10/10'; end; end; Foo.new" 10/10/10 The problem in your example is that in Ruby, the constructor is an instance method, not a class method. So your mistake was to define self.initialize instead of just initialize. class Foo def initialize

Re: [MacRuby-devel] Editing MacRuby's website

2010-10-10 Thread Caio Chassot
On 2010-10-10, at 13:33 , Matt Aimonetti wrote: > > You might want to refresh your browser, One such page: http://www.macruby.org/contact-us.html > otherwise there is a section in the documentation explaining how to > contribute content for the website using a github repo. For lurkers and futu

[MacRuby-devel] Objective-C class +initialize in MacRuby

2010-10-10 Thread Caio Chassot
Hi, It looks like self.initialize is a no-go: class Foo def self.initialize NSLog("self.initialize is a sd panda") # <- never runs end end The ruby idiom for that would be just: class Foo NSLog("IM IN UR CLASS INITIALIZEEN FROM RUBY") end is that

Re: [MacRuby-devel] Editing MacRuby's website

2010-10-10 Thread Matt Aimonetti
You might want to refresh your browser, otherwise there is a section in the documentation explaining how to contribute content for the website using a github repo. Btw, we have some content that needs to be deployed soon, maybe the fix is there. - Matt Sent from my iPhone On Oct 10, 2010, at

[MacRuby-devel] Editing MacRuby's website

2010-10-10 Thread Caio Chassot
Hi, Is the MacRuby website on a public repo? I'm seeing a lot of pages still say "Current Version: 0.6". Other than that there's a bunch of outdated info. It would be great if the site were on, say, github, so everyone could submit fixes. Is it available anywhere? ___