This commit fix #69.

This commit is contained in:
Petr Korolev 2015-03-18 10:18:58 +02:00
parent b0be9f8b06
commit a4f93feb7d

View File

@ -36,7 +36,6 @@ module GitHubChangelogGenerator
if @options[:pulls]
@pull_requests = self.get_filtered_pull_requests
self.fetch_merged_at_pull_requests
else
@pull_requests = []
end
@ -138,12 +137,12 @@ module GitHubChangelogGenerator
def get_filtered_pull_requests
pull_requests = @pull_requests
filtered_pull_requests = pull_requests
self.fetch_merged_at_pull_requests
filtered_pull_requests = @pull_requests.select {|pr| pr[:merged_at] != nil }
unless @options[:include_labels].nil?
filtered_pull_requests = pull_requests.select { |issue|
filtered_pull_requests = @pull_requests.select { |issue|
#add all labels from @options[:incluse_labels] array
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
}
@ -157,7 +156,7 @@ module GitHubChangelogGenerator
end
if @options[:add_issues_wo_labels]
issues_wo_labels = pull_requests.select {
issues_wo_labels = @pull_requests.select {
# add issues without any labels
|issue| !issue.labels.map { |label| label.name }.any?
}