[MacRuby-devel] RubyCocoa layer

Pierce T. Wetter III pierce at twinforces.com
Mon Jul 7 15:26:05 PDT 2008


On Jul 6, 2008, at 3:29 PM, Laurent Sansonetti wrote:

> On Jun 24, 2008, at 1:27 AM, Eloy Duran wrote:
>>> - I wonder if it's necessary to commit the RubyCocoa samples in
>>> sample-
>>> macruby as you did. Ultimately we might be able to run all RubyCocoa
>>> samples, but we probably don't want to have all of them in macruby-
>>> sample, right? Maybe some of the samples could be moved in the test
>>> directory, for testing purposes?
>>>
>>> I think people will be confused to see a RubyCocoa directory in /
>>> Developer/Examples/Ruby/MacRuby.
>>
>> Hmm I understand, not 100% sure that moving them to test/ feels
>> better,
>> but let's see :)
>
> Actually, since the RubyCocoa examples are already available in /
> Developer/Examples/Ruby/RubyCocoa, and that in theory the layer should
> just run them without any modification, why not just keeping a
> RUBYCOCOA_README text file (like the one you wrote) with the list of
> samples that work, and those which not. Or we can do this in the wiki
> alternatively.
>
> Anyway, the RubyCocoa samples should not IMHO be duplicated in sample-
> macruby.

  BTW, the rubycocoa layer isn't quite working for me yet:

2008-07-07 15:12:30.032 Frictionless[14025:813] fetchedpassword
/Users/pierce/svnProjects/build/Release/Frictionless.app/Contents/ 
Resources/Action-mr.rb:847:in `isUrgent': undefined local variable or  
method `super_isUrgent' for #<Action_Action_:0x196a6a0> (NameError)
	from /Users/pierce/svnProjects/build/Release/Frictionless.app/ 
Contents/Resources/Action-mr.rb:1003:in `appLaunch'

   def isUrgent
     result = super_isUrgent
     result = 0 unless result != nil
     result
   end


  The superclass definition of isUrgent is on the ObjC side, so the  
full inheritance path is:

   Action (Ruby) < Machine_Action_rb (Ruby) < Machine_Action (ObjC)  :  
KSExtensibleManagedObject : NSManagedObject

  Though its the Machine_Action.m file that defines isUrgent:

- (NSNumber*)isUrgent {
	[self willAccessValueForKey:@"isUrgent"];
	NSNumber *result = [self primitiveValueForKey:@"isUrgent"];
	[self didAccessValueForKey:@"isUrgent"];
	return result;
}






More information about the MacRuby-devel mailing list