Class: PrChangelog::NotReleasedChanges
- Inherits:
-
Object
- Object
- PrChangelog::NotReleasedChanges
- Defined in:
- lib/pr_changelog/not_released_changes.rb
Overview
Calculates a list of not released changes from ‘base_ref` to `current_ref` those changes consist of the merged pull-request title
Instance Attribute Summary collapse
-
#commits_strategy ⇒ Object
readonly
Returns the value of attribute commits_strategy.
Instance Method Summary collapse
- #emoji_tags ⇒ Object
- #formatted_changelog ⇒ Object
- #grouped_formatted_changelog ⇒ Object
-
#initialize(commits_strategy) ⇒ NotReleasedChanges
constructor
A new instance of NotReleasedChanges.
Constructor Details
#initialize(commits_strategy) ⇒ NotReleasedChanges
Returns a new instance of NotReleasedChanges.
9 10 11 |
# File 'lib/pr_changelog/not_released_changes.rb', line 9 def initialize(commits_strategy) @commits_strategy = commits_strategy end |
Instance Attribute Details
#commits_strategy ⇒ Object (readonly)
Returns the value of attribute commits_strategy.
7 8 9 |
# File 'lib/pr_changelog/not_released_changes.rb', line 7 def commits_strategy @commits_strategy end |
Instance Method Details
#emoji_tags ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/pr_changelog/not_released_changes.rb', line 13 def = {} PrChangelog.config..each_with_index do |item, index| [item[:prefix]] = Tag.new(item[:emoji], item[:title], index) end end |
#formatted_changelog ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/pr_changelog/not_released_changes.rb', line 23 def formatted_changelog if parsed_change_list.count.positive? parsed_change_list.map(&:to_s).join("\n") else no_changes_found end end |
#grouped_formatted_changelog ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/pr_changelog/not_released_changes.rb', line 31 def grouped_formatted_changelog if parsed_change_list.count.positive? GroupedChanges.new(parsed_change_list, ).to_s else no_changes_found end end |