Introduction
RubyBreaker is a dynamic type documentation tool written in pure Ruby. It provides the framework for dynamically instrumenting a Ruby program to monitor objects during the execution and document the observed type information. In addition, it can perform early dynamic type checking. In other words, RubyBreaker helps Ruby programs "break" out of obscurities and convolutions by documenting the type information. The type documentation generated by RubyBreaker is also an executable Ruby code that can be used as an input to subsequent analyses.
The primary goal of RubyBreaker is to assign a type signature to every method in selected modules and classes. A type signature is written in the RubyBreaker Type Annotation Language which resembles the documentation style used in Ruby Core Library Doc. No manual code change is required. Overall, this tool should help Ruby programmers document their code more rigorously and effectively.
Currently, RubyBreaker does not
- Auto-document block arguments (inherent)
- Support parametric polymorphic types
- Support RDoc or YARD output format
To contribute to the project, visit RubyBreaker's GitHub page and RubyGems page. The web version of this document and the tutorial can be found here.
Requirements
Ruby 1.9.x and TreeTop 1.x
If the most recent Ruby 1.9 is installed on the computer, it will probably work. If TreeTop is not installed, use RubyGems or download from the following URL: TreeTop
Installation
It is as simple as running the following command:
$ gem install rubybreaker