From 1ae86e3cb220a1f3092356693551168d11671546 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 25 Aug 2015 13:14:04 +0300 Subject: [PATCH] rename and convert string to sybol --- .../generator/generator_fetcher.rb | 4 ++-- .../generator/generator_processor.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_fetcher.rb b/lib/github_changelog_generator/generator/generator_fetcher.rb index b166922..988f3ed 100644 --- a/lib/github_changelog_generator/generator/generator_fetcher.rb +++ b/lib/github_changelog_generator/generator/generator_fetcher.rb @@ -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 diff --git a/lib/github_changelog_generator/generator/generator_processor.rb b/lib/github_changelog_generator/generator/generator_processor.rb index d162cbc..e264a90 100644 --- a/lib/github_changelog_generator/generator/generator_processor.rb +++ b/lib/github_changelog_generator/generator/generator_processor.rb @@ -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)