Retrieve the sourcecode for a method as a Ruby string


The `method_source` is a utility to return a method's sourcecode as a Ruby string. Also returns `Proc` and `Lambda` sourcecode.

Method comments can also be extracted using the `comment` method.

It is written in pure Ruby (no C).
 - Some Ruby 1.8 support now available.
 - Support for MRI, RBX, JRuby, REE

`method_source` provides the `source` and `comment` methods to the `Method` and `UnboundMethod` and `Proc` classes.

Upload more screenshots

Please help extend the collection of screenshots. Just make a screenshot and upload it here. You don't need to register or anything.

Upload a screenshot

Hint: upload an image here from your clipboard with Ctrl-V


Install this software package

If the package is available for the distribution you are currently using on your computer then install the software by clicking on…

Install ruby-method-source