Sha256: 0428f9353d4765d9f9cab97289a226d7eb24af9060d8e36b7a01705569064801

Contents?: true

Size: 362 Bytes

Versions: 3

Compression:

Stored size: 362 Bytes

Contents

# frozen_string_literal: true

module Punchlist
  # Render a text format of offenses
  class CliRenderer
    def render(output)
      lines = output.map do |offense|
        "#{offense.filename}:#{offense.line_num}: #{offense.line}"
      end
      out = lines.join("\n")
      if out.empty?
        out
      else
        out + "\n"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
punchlist-1.3.2 lib/punchlist/renderer.rb
punchlist-1.3.1 lib/punchlist/renderer.rb
punchlist-1.3.0 lib/punchlist/renderer.rb