On 7/21/09, Tony Arcieri <tony / medioh.com> wrote: > I've been considering rewriting my require_all gem: > > http://github.com/tarcieri/require_all/ > > ...to parse the Ruby source code, extracting a list of constants a > particular file defines and a list of constants that are expected to be > defined before a file is loaded. [snip] > What's the best gem to do this with? ruby_parser? No doubt its author will say it is, but I'd like to recommend my own library, RedParse. If you can stand its painful slowness, it outputs the nicest parsetrees. see: http://github.com/coatl/redparse or simply: gem install redparse You should also consider ParseTree, which is likely to be faster than either of the others.