Sha256: 45050a41a5eb3e1fb445a9b90d438fb2f916f13bb076be550433658e7d2f4d65

Contents?: true

Size: 370 Bytes

Versions: 23

Compression:

Stored size: 370 Bytes

Contents

require 'pre-commit/line'

module PreCommit
  class ErrorList < Struct.new :errors

    def initialize(errors = [])
      case errors
      when "",nil then errors = []
      when String then errors = [PreCommit::Line.new(errors)]
      end
      super errors
    end

    def to_a
      errors.map(&:to_s)
    end

    def to_s
      to_a.join("\n")
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pre-commit-0.22.0 lib/pre-commit/error_list.rb
pre-commit-0.21.0 lib/pre-commit/error_list.rb
pre-commit-0.20.0 lib/pre-commit/error_list.rb