GetComments - Extract Comments from Ruby Code

Gem Version Build Status Maintainability Test Coverage


This library provides an easy way to extract comments from a ruby source file.


Install

$ gem install getcomments

Or with bundler:

gem 'getcomments'

Usage

require 'getcomments'
comments = GetComments::Read.from 'filename.rb'
p comments

# => {
#      "module TestModule" => "This is the module comment",
#      "class TestClass"   => "This is the class comment",
#      "def some_method"   => "This is a multiline\nmethod comment"
#    }