diff --git a/lib/github_changelog_generator/generator/entry.rb b/lib/github_changelog_generator/generator/entry.rb index ac85ea5a3..ef80de380 100644 --- a/lib/github_changelog_generator/generator/entry.rb +++ b/lib/github_changelog_generator/generator/entry.rb @@ -40,6 +40,15 @@ def generate_entry_for_tag(pull_requests, issues, newer_tag_name, newer_tag_link @content end + def line_labels_for(issue) + labels = if @options[:issue_line_labels] == ["ALL"] + issue["labels"] + else + issue["labels"].select { |label| @options[:issue_line_labels].include?(label["name"]) } + end + labels.map { |label| " \[[#{label['name']}](#{label['url'].sub('api.github.com/repos', 'github.com')})\]" }.join("") + end + private # Creates section objects for this entry. @@ -205,14 +214,5 @@ def add_unmapped_section(issues) end nil end - - def line_labels_for(issue) - labels = if @options[:issue_line_labels] == ["ALL"] - issue["labels"] - else - issue["labels"].select { |label| @options[:issue_line_labels].include?(label["name"]) } - end - labels.map { |label| " \[[#{label['name']}](#{label['url'].sub('api.github.com/repos', 'github.com')})\]" }.join("") - end end end diff --git a/lib/github_changelog_generator/generator/section.rb b/lib/github_changelog_generator/generator/section.rb index 538b2b15b..49e2c00dc 100644 --- a/lib/github_changelog_generator/generator/section.rb +++ b/lib/github_changelog_generator/generator/section.rb @@ -7,7 +7,7 @@ module GitHubChangelogGenerator # # @see GitHubChangelogGenerator::Entry class Section - attr_accessor :name, :prefix, :issues, :labels, :body_only + attr_accessor :name, :options, :prefix, :issues, :labels, :body_only def initialize(opts = {}) @name = opts[:name] @@ -49,7 +49,7 @@ def get_string_for_issue(issue) encapsulated_title = encapsulate_string issue["title"] title_with_number = "#{encapsulated_title} [\\##{issue['number']}](#{issue['html_url']})" - title_with_number = "#{title_with_number}#{line_labels_for(issue)}" if @options[:issue_line_labels].present? + title_with_number = "#{title_with_number}#{Entry.new(options).line_labels_for(issue)}" if @options[:issue_line_labels].present? line = issue_line_with_user(title_with_number, issue) issue_line_with_body(line, issue) end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy