Sha256: 34c9df56a0195468f9914ba52258360293ad912312ec33690849872042c545d4

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

module Danger
  module Changelog
    # An abstract CHANGELOG.md line.
    class ChangelogLine
      attr_accessor :line

      def initialize(line)
        self.line = line
      end

      # Match the line with the validation rules
      def valid?
        raise 'ChangelogLine subclass must implement the valid? method'
      end

      # Match the line with the validation rules opposite to valid?
      def invalid?
        !valid?
      end

      # Match the given line if it potentially represents the specific changelog line
      def self.validates_as_changelog_line?(_line)
        abort "You need to include a function for #{self} for validates_as_changelog_line?"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danger-changelog-0.4.0 lib/changelog/changelog_line/changelog_line.rb
danger-changelog-0.3.0 lib/changelog/changelog_line/changelog_line.rb
danger-changelog-0.2.1 lib/changelog/changelog_line/changelog_line.rb