I'm starting a project with several contributors. We want to keep track of who wrote what code, as well as to get a count of how many methods, controller actions, and views a contributor has written. This necessitates a level of meta-programming that none of us are familiar with.
So far, the best idea we've come up with is to add a comment before each snippet of code with the contributor's username and a short, consistent phrase. For instance:
# method by RacerX
def a_useful_method
. . .
end
# method by MysteryProgrammer123
def another_useful_method
. . .
end
# action by MysteryProgrammer123
def new
. . .
end
Then we'd run a method to count all instances of action by
and method by
and view by
that each user has written throughout the project. Unfortunately, we don't know how to write Ruby code that can inspect other Ruby code. It might not even be possible. If it is possible, though, how is it done?
Alternatively, there might be a better approach that we're not considering.