Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bugfix: undefined method line_labels_for#753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ferrarimarco merged 1 commit intogithub-changelog-generator:masterfromunknown repositoryApr 11, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletionslib/github_changelog_generator/generator/entry.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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.
Expand DownExpand Up@@ -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
4 changes: 2 additions & 2 deletionslib/github_changelog_generator/generator/section.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If we're not using the setter, can:options become aattr_reader?


def initialize(opts = {})
@name = opts[:name]
Expand DownExpand Up@@ -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?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps later, one can build an@entry to be used to repeatedly make theline_labels_for call on?

line = issue_line_with_user(title_with_number, issue)
issue_line_with_body(line, issue)
end
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp