Sha256: f2ab2d9c6e94c2bf28b001b981553cf9ed60a041036d0e2dca3afdc4f0b07848

Contents?: true

Size: 469 Bytes

Versions: 39

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

module Doing
  # An individual changelog item
  class Entry
    attr_reader :type, :string

    attr_writer :prefix

    def initialize(string, type, prefix: false)
      @string = string
      @type = type
      @prefix = prefix
    end

    def clean(string)
      string.gsub(/\|/, '\|')
    end

    def print_prefix
      @prefix ? "#{@type}: " : ''
    end

    def to_s
      "- #{print_prefix}#{clean(@string)}"
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
doing-2.1.88 lib/doing/changelog/entry.rb
doing-2.1.87 lib/doing/changelog/entry.rb
doing-2.1.86 lib/doing/changelog/entry.rb
doing-2.1.85 lib/doing/changelog/entry.rb
doing-2.1.84 lib/doing/changelog/entry.rb
doing-2.1.83 lib/doing/changelog/entry.rb
doing-2.1.82 lib/doing/changelog/entry.rb
doing-2.1.81 lib/doing/changelog/entry.rb
doing-2.1.80 lib/doing/changelog/entry.rb
doing-2.1.79 lib/doing/changelog/entry.rb
doing-2.1.78 lib/doing/changelog/entry.rb
doing-2.1.77 lib/doing/changelog/entry.rb
doing-2.1.76 lib/doing/changelog/entry.rb
doing-2.1.75 lib/doing/changelog/entry.rb
doing-2.1.74 lib/doing/changelog/entry.rb
doing-2.1.73 lib/doing/changelog/entry.rb
doing-2.1.72 lib/doing/changelog/entry.rb
doing-2.1.69 lib/doing/changelog/entry.rb
doing-2.1.68 lib/doing/changelog/entry.rb
doing-2.1.66 lib/doing/changelog/entry.rb