Sha256: 4693659d1b948a810a3634401d00aac5daf17ea75c7f6aa07e68403a3288ac30

Contents?: true

Size: 585 Bytes

Versions: 11

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module Reporters
      # Reports issues related to an invalid line within the commit body.
      class Line
        DEFAULT_INDENT = "    "

        def initialize data = {}
          @data = data
        end

        def to_s
          if content.include? "\n"
            Lines::Paragraph.new(data).to_s
          else
            Lines::Sentence.new(data).to_s
          end
        end

        private

        attr_reader :data

        def content
          data.fetch :content
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
git-lint-2.2.1 lib/git/lint/reporters/line.rb
git-lint-2.2.0 lib/git/lint/reporters/line.rb
git-lint-2.1.0 lib/git/lint/reporters/line.rb
git-lint-2.0.0 lib/git/lint/reporters/line.rb
git-lint-1.4.0 lib/git/lint/reporters/line.rb
git-lint-1.3.0 lib/git/lint/reporters/line.rb
git-lint-1.2.0 lib/git/lint/reporters/line.rb
git-lint-1.1.1 lib/git/lint/reporters/line.rb
git-lint-1.1.0 lib/git/lint/reporters/line.rb
git-lint-1.0.1 lib/git/lint/reporters/line.rb
git-lint-1.0.0 lib/git/lint/reporters/line.rb