Class: Annotato::LineFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/annotato/line_formatter.rb

Class Method Summary collapse

Class Method Details

.format(lines) ⇒ Object



5
6
7
8
9
# File 'lib/annotato/line_formatter.rb', line 5

def self.format(lines)
  lines.map do |line|
    line.strip.empty? ? "#" : (line.start_with?("#") ? line : "# #{line.rstrip}")
  end.join("\n")
end