Module: Wool::Advice::CommentAdvice::InstanceMethods

Defined in:
lib/wool/advice/comment_advice.rb

Instance Method Summary collapse

Instance Method Details

#comment_removing_twiddler(body = self.body, settings = {}) ⇒ Object

This twiddler aims to remove comments and trailing whitespace from the ruby source input, so that warnings that aren’t concerned with the implications of comments in their source can safely discard them. Uses Ripper to look for comment tokens.



31
32
33
# File 'lib/wool/advice/comment_advice.rb', line 31

def comment_removing_twiddler(body = self.body, settings = {})
  [split_on_token(body, :on_comment).first.rstrip, settings]
end