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.40.0 lib/pre-commit/error_list.rb
pre-commit-0.39.0 lib/pre-commit/error_list.rb
pre-commit-0.38.1 lib/pre-commit/error_list.rb
pre-commit-0.38.0 lib/pre-commit/error_list.rb
pre-commit-0.37.0 lib/pre-commit/error_list.rb
pre-commit-0.36.0 lib/pre-commit/error_list.rb
pre-commit-0.35.0 lib/pre-commit/error_list.rb
pre-commit-0.34.0 lib/pre-commit/error_list.rb
pre-commit-0.33.0 lib/pre-commit/error_list.rb
pre-commit-0.32.0 lib/pre-commit/error_list.rb
pre-commit-0.31.0 lib/pre-commit/error_list.rb
pre-commit-0.30.0 lib/pre-commit/error_list.rb
pre-commit-0.29.0 lib/pre-commit/error_list.rb
pre-commit-0.28.0 lib/pre-commit/error_list.rb
pre-commit-0.27.0 lib/pre-commit/error_list.rb
pre-commit-0.26.0 lib/pre-commit/error_list.rb
pre-commit-0.25.0 lib/pre-commit/error_list.rb
pre-commit-0.24.0 lib/pre-commit/error_list.rb
pre-commit-0.23.0 lib/pre-commit/error_list.rb
pre-commit-0.22.1 lib/pre-commit/error_list.rb