Module: Danger::Changelog::Parsers

Defined in:
lib/changelog/parsers.rb,
lib/changelog/parsers/base.rb,
lib/changelog/parsers/intridea_format.rb,
lib/changelog/parsers/keep_a_changelog.rb,
lib/changelog/parsers/validation_result.rb

Defined Under Namespace

Classes: Base, IntrideaFormat, KeepAChangelog, ValidationResult

Constant Summary collapse

FORMATS =
{ intridea: IntrideaFormat, keep_a_changelog: KeepAChangelog }.freeze

Class Method Summary collapse

Class Method Details

.default_formatObject



12
13
14
# File 'lib/changelog/parsers.rb', line 12

def default_format
  :intridea
end

.lookup(format) ⇒ Object



20
21
22
23
24
# File 'lib/changelog/parsers.rb', line 20

def lookup(format)
  FORMATS
    .fetch(format, IntrideaFormat)
    .new
end

.valid?(format) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/changelog/parsers.rb', line 16

def valid?(format)
  FORMATS.keys.map(&:to_s).include?(format.to_s)
end