No commit activity in last 3 years
No release in over 3 years
Commenct collector
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

>= 0
 Project Readme

Build Status

CommentCollector

Get source code comments of Ruby.

Installation

Or install it yourself as:

$ gem install comment_collector

Usage

example.rb

# class comment
# this is sample
class Foo
  BAR = 'hello' # string

  # method
  def say
    'hi'
  end
end

=begin
multi line
comments
=end

comment.rb

require 'comment_collector'

comments = CommentCollector.get(File.read('example.rb'))

puts '=' * 20

comments.each do |comment|
  puts comment.value
  puts '=' * 20
end

result

$ ruby comment.rb
====================
# class comment
# this is sample
====================
# string
====================
# method
====================
=begin
multi line
comments
=end
====================

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the CommentCollector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.