Thursday, May 14, 2009

Tool Version Tracker rails application for sourceforge tools

There are many sourceforge open source tools and it is sometimes difficult to track the latest vesions of all tools and keep us updated. We should atleast try to track the latest versions of the open source tools that we daily use in our projects.

So why not develop a very simple rails application which will allow you to add, edit and destroy tool information, the sourceforge url, version information, etc. Let's develop tool version tracker app with CRUD operations and some logic to track the tool versions :-) The logic may not be great but definitely useful for core developers who are always looking for new things/tools/versions ! Find the updated versions of the sourceforge tools and send an email with the updated versions to all team members :-) We can either run this periodically through web application or we can do some modifications to run this as a scheduled cron job :-)

We will use hpricot for parsing html.
Let's take an example of checkstyle. If we go to this link :- http://sourceforge.net/project/showfiles.php?group_id=29721

We will find the version information as :-


So in our code we will just compare the release number by parsing the html with hpricot and find out any change in version of the tool.

Here is the code in html_parser.rb under lib :-



In the environment.rb file, add the following line :-

SOURCEFORGE_URL = "http://sourceforge.net/project/showfiles.php?group_id="

For each tool, we have a unique group id.

The migration for Tool model is as below :-



You can view all the tools on index as below :-


You can find the updated version of individual tool or all tools by clicking on the links. So after clicking on the Update versions of all tools, you will get :-



And an email is also sent with the latest information (Simple Rails ActionMailer):-




You can edit/add the tool information from your application as :-


So how do you find it ? It is simple and easy to develop through Rails and definitely useful for all the Automated Tool Lovers :-)
It certainly solves our purpose :-)

No comments:

Post a Comment