From: Eric Hodel Date: 2006-02-04T06:51:08+09:00 Subject: Re: Parsing Ruby with Ruby On Feb 2, 2006, at 5:14 AM, John Wells wrote: > I'd like to write a code analysis tool that could read Ruby or Rails > projects (so both standard .rb files and also erb files) and do some > simple code analysis and metrics, like what methods are called (and > how > many times), etc, etc. > > What libraries or tools are out there that might help one > accomplish this? ParseTree is probably the best tool for this job, it returns the AST for ruby methods as a tree of arrays and includes a class for processing and rewriting the AST called SexpProcessor. It comes with an ABC metrics tool (assignments, branches, calls) and is the backbone of the ruby2c project. http://rubyforge.org/projects/parsetree/ -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com