lib/rbs/annotate/formatter.rb in rbs-2.6.0 vs lib/rbs/annotate/formatter.rb in rbs-2.7.0.pre.1

- old
+ new

@@ -1,21 +1,23 @@ +# frozen_string_literal: true + module RBS module Annotate class Formatter attr_reader :buffer def initialize() - @buffer = "" + @buffer = +"" @pending_separator = nil end def <<(s) if s if s.is_a?(RDoc::Markup::Document) s = self.class.translate(s) or raise end - s.rstrip! + s = s.rstrip unless s.empty? if ss = @pending_separator buffer << ss buffer << "\n"