nhmood / watson-ruby

inline issue manager
MIT License
634 stars 50 forks source link

Break up the comment parsing to smaller module #251

Open alpaca-tc opened 10 years ago

alpaca-tc commented 10 years ago

I want to break up the comment parsing in watson-ruby to smaller module. There are three reasons for this.

They are the reasons why I present a suggestion.


Currently I am writing the gem called CommentExtractor. It can easily extract comments from a file as follows.

path = 'path/to/file'
if parser = CommentExtractor::Parser.for(path)
  comments = parser.parse

  comments.each do |c|
    puts "#{c.file}:#{c.line} - #{c.value}" #=> "path/to/file:2 - I am comment"
  end
end

If watson-ruby merged CommentExtractor, it becomes that easier to extract comments. Let me know if you have any opinion, suggestions or problems on my suggestion.


links