[MacRuby-devel] HotCocoa Part I

Chris McGrath chris at octopod.info
Tue Dec 2 18:00:51 PST 2008


On 3 Dec 2008, at 00:45, Rich Morin wrote:

> At 01:27 +0000 12/3/08, Chris McGrath wrote:
>> One thing I've been considering since watching your RubyConf
>> presentation via confreaks is ...
>
> Just to be clear, Rich Kilmer is the HC developer that made the
> RubyConf presentation; I'm just a MacRuby and HotCocoa wannabe...
>

Ooops, I must have some sort of richlexia, you aren't the first two  
I've got confused!
>
>> ... auto-generating documentation about what's mapped to what.
>> I haven't looked at the code enough to know if it's feasible,
>> but I'd like to see something like:
>>
>> text_field -> NSTextField (selectable: false, bordered: false, ...)
>> #i.e. the defaults
>>
>> Most of these would be obvious, but are currently "hidden" away down
>> in the MacRuby source. I'd like to see mappings both ways, so as
>> someone who knows a bit of cocoa I can easily go check if NSFoo has
>> been wrapped by someone and what the wrappings are. I love how the
>> mappings are implemented, but I won't be able to keep them all in my
>> head!
>
> OK; here's a partly-baked idea, loosely inspired by Python docstrings.
>
> <PBI>
> The HC declarations are (I assume) stashing information away in some
> sort of data structure.  If not, they certainly could be (:-).  Once
> the information is available at runtime, any HC script could retrieve
> them for use in online documentation.
>
> Of course, as RK indicates, HC is lazy about loading frameworks.  So,
> a comprehensive documentation generator would have to force loading of
> all possible frameworks.
>
> It may also be that HC doesn't store as much information as we'd like
> to have in the docs.  No problem; add a few more methods (etc) to let
> developers add these "annotations".
> </PBI>
>

On first skim, it seems that as well as adding ruby methods and  
constants, lib/hotcocoa/mapping.rb could be persuaded to do something  
like that. I'd envisage this being a tool you could run on a mapping  
file to spit out html / rdoc / whatever. I don't have time this week  
but I'd like to look into something like this soon.

Cheers,

Chris


More information about the MacRuby-devel mailing list