rename and convert string to sybol

This commit is contained in:
Petr Korolev 2015-08-25 13:14:04 +03:00
parent 7e4d546f60
commit 1ae86e3cb2
2 changed files with 8 additions and 8 deletions

View File

@ -48,11 +48,11 @@ module GitHubChangelogGenerator
# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
# @param [Hash] issue
def find_closed_date_by_commit(issue)
unless issue["events"].nil?
unless issue[:events].nil?
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
compare_string = issue[:merged_at].nil? ? "closed" : "merged"
# reverse! - to find latest closed event. (event goes in date order)
issue["events"].reverse!.each do |event|
issue[:events].reverse!.each do |event|
if event[:event].eql? compare_string
set_date_from_event(event, issue)
break

View File

@ -63,21 +63,21 @@ module GitHubChangelogGenerator
end
# Method filter issues, that belong only specified tag range
# @param [Array] array of issues to filter
# @param [Array] issues issues to filter
# @param [Symbol] hash_key key of date value default is :actual_date
# @param [String] older_tag all issues before this tag date will be excluded. May be nil, if it's first tag
# @param [String] newer_tag all issue after this tag will be excluded. May be nil for unreleased section
# @return [Array] filtered issues
def delete_by_time(array, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
def delete_by_time(issues, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
# in case if not tags specified - return unchanged array
return array if older_tag.nil? && newer_tag.nil?
return issues if older_tag.nil? && newer_tag.nil?
newer_tag_time = newer_tag && get_time_of_tag(newer_tag)
older_tag_time = older_tag && get_time_of_tag(older_tag)
array.select do |req|
if req[hash_key]
time = Time.parse(req[hash_key]).utc
issues.select do |issue|
if issue[hash_key]
time = Time.parse(issue[hash_key]).utc
tag_in_range_old = tag_newer_old_tag?(older_tag_time, time)