Documenting Rails App

If you want to make code features easily grep-able you may consider using categorical comment markers all with the same format. Array-sort, JSON-sort, JavaScript-sort, jQuery-sort. Then to see what specialized sort methods you have you can simply grep -nR [-]sort

> grep -nR [-]sort
example.txt:1:JSON-sort
example.txt:2:jQuery-sort
example.txt:3:JavaScript-sort
example.txt:4:Array-sort

This returns the file, line number, and section of code from your grep search. And if you’ve properly rDoc’d the same section you labelled the search tag the documentation is right there as well. Following this pattern Array#reverse would also be categorized as Array-sort since reversing is in the sorting class.

1 Like