This is the idea I am thinking of proposing for my Google Summer of Code project. This is from the Google Summer of Code thread:
I was struck with an idea yesterday that could theoretically be really nice for Ruby developers. I'm sure most of us are aware of the idea of keeping code DRY (Don't Repeat Yourself), and I think most people that know about it don't have too much of a problem with following it. Another idea that programmers follow, not as well, is to not reinvent the wheel, which for the sake of the rest of this e-mail I will refer to as DROP (Don't Repeat Other People).
My idea is to create an open source code repository, web site, and set of tools designed to help people to automate the process of factoring code out of their projects which they can all share. First, it helps them to find instances of code that need to be DRYed or DROPed by comparing lines of code across the entire code base in the repository and pointing out lines that are similar to things that have already been done before. If the programmer finds things within his program which he repeated, then it should be a simple a matter of factoring out to another function or class within his code to DRY it. If he finds that somebody else has similar code, he can factor it out into a separate "project" in the repository to DROP it. People with similar code in the repository are notified so that they can update their individual projects accordingly if they desire to do so.
Using code that has been factored out into these external projects should be both easy to integrate and easy to keep up to date in each project. Though I'm not quite sure of the mechanics of how that would be done yet, I'm envisioning a script programmers can run that will bring all functions and classes they are using from external projects up to date in their own program. As it does this, it runs all the programmer's tests to make sure that it doesn't break something and pulls back to a previous revision if necessary. (As such, it would practically be a requirement that all code that takes advantage of this be unit tested.) This would also provide the benefit that factored out projects can be edited by anyone, like a wiki, without screwing everything up; any time something gets messed up or is incompatible with some projects, somebody will see when they try to update and can fix it themselves.
The web site would show the projects in the repository, provide a method of discussion around the various bits of code, and give downloads and instructions for using the resource for yourself.
My hope is that this would be a tool that could speed up development, simplify and stabilize Ruby programs, and bring a collaborative atmosphere even to individual projects.
I'm making a thread for it because I'm looking for input (ideas, suggestions, etc.).
- Jake McArthur