Access count since 2002/3/3

Tools for programmers by Ruby

(Japanese | English)

KATTA Hitoshi

I made these tools for Java programmers and C++ programmers, but all tools are written in Ruby. I'm happy if you enjoy these small tools.

Tools for Java programmers

(1)List up unnecessary classes, interfaces and unnecessary members

I used this tool to remove unnecessary codes before maintenance of a complex unfamiliar application.

 > ruby memberCheck.rb rootPath targetPath outputPath


The absolute path of the root folder of all source codes.


The target source file or folder of this source code analysis. The relative path from rootPath.


output file.

The results are hints of your further analysis. This tool does not care polymorphism and reflections. And assumes that one file includes only one class definition.

You have to check the results by your self.

(2)Line oriented source code formatter for JDK style

This is a simple line oriented source code formatter. It will be easy to customize this program by your self.

 > ruby format.rb [OPTIONS] sourcePath

Format the source file to mach the JDK cording standards.
The formatted file suffix is ".new" and the change information file suffix is ".diff".


The path of a source file or a folder.


Backup the original file and overwrite the original file with the formatted codes. The backup suffix is ".old".


Overwrite the original file with the formatted codes without backup file and diff file.

-r, -R

format the contents of directory recursively

You have to check the results by your self.

Tools for C++ programmers

(1)A testSuite generator for CppUnit
I changed the testSuite generator for CppUnit-x by SHIBUKAWA Yoshiki to support CppUnit 1.6.2.
I referred the program by FUKUDA (episteme) Fumiki before I wrote this program.

 > ruby makeTestSuite.rb [prefix]

Parse all files which name ends with "Test.h" in the current directory, and list up all methods which matches "void testXXX()". And makes a TestSuite class files and Tester.cpp.
But if the class has a suite() method, the TestSuite class call the suite() method.


prefix of the TestSuite file.