Class: Danger::Changelog::ChangelogLineParser
- Inherits:
-
Object
- Object
- Danger::Changelog::ChangelogLineParser
- Defined in:
- lib/changelog/changelog_line/changelog_line_parser.rb
Overview
A parser of the CHANGELOG.md lines
Class Method Summary collapse
- .available_changelog_lines ⇒ Object
-
.parse(line) ⇒ Object
Returns an instance of Changelog::ChangelogLine class based on the given line.
Class Method Details
.available_changelog_lines ⇒ Object
20 21 22 23 |
# File 'lib/changelog/changelog_line/changelog_line_parser.rb', line 20 def self.available_changelog_lines # Order is important [ChangelogPlaceholderLine, ChangelogEntryLine, ChangelogHeaderLine] end |
.parse(line) ⇒ Object
Returns an instance of Changelog::ChangelogLine class based on the given line
10 11 12 13 14 15 16 |
# File 'lib/changelog/changelog_line/changelog_line_parser.rb', line 10 def self.parse(line) changelog_line_class = available_changelog_lines.find do |changelog_line| changelog_line.validates_as_changelog_line?(line) end return nil unless changelog_line_class changelog_line_class.new(line) end |