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

Defined Under Namespace

Classes: Base, IntrideaFormat, KeepAChangelog

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.default_formatObject



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

def default_format
  :intridea
end

.lookup(format) ⇒ Object



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

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

.valid?(format) ⇒ Boolean

Returns:

  • (Boolean)


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

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