jimfoltz / SketchUp-Ruby-API-Doc

Help Document the SketchUp Ruby API using Yard
12 stars 5 forks source link

Extract number of arguments for autogen tool? #25

Open thomthom opened 9 years ago

thomthom commented 9 years ago

I was wondering if we might be able to stub out arguments based on the arity of methods. Though, we'd not be able to extract sensible argument names so I guess the tool would then be smart enough to not overwrite the arguments of existing method stubs.

Not sure if it would be worth it?

Aerilius commented 9 years ago

The tool is maybe in some ways similar to my stubmaker. The stubmaker does create a full method signature with the amount of arguments, but all named as arg1, arg2

I find it is only little useful info and does not save much work since you have to rename the arguments anyways to add the semantics back. Also because Ruby does not support real overloading (it's most times done by branching inside the method body, which inspection can not detect), we will get *args for most methods.

jimfoltz commented 9 years ago

I do not remember how I started generating the docs. I so not think it was with Stubmaker but something I cobbled together.

It's not worth it to generate the docs at this point. There is no way currently to reproduce all the yard comments people have added. For it to work, those yard docs would need to be split into individual files and then a script would need to recombine them with the generated stub files into complete source code.