diff --git a/lib/github_changelog_generator/generator/generator.rb b/lib/github_changelog_generator/generator/generator.rb index 3ac896d..4f00ec1 100644 --- a/lib/github_changelog_generator/generator/generator.rb +++ b/lib/github_changelog_generator/generator/generator.rb @@ -10,7 +10,7 @@ module GitHubChangelogGenerator end class Generator - attr_accessor :options, :all_tags, :github + attr_accessor :options, :filtered_tags, :github # A Generator responsible for all logic, related with change log generation from ready-to-parse issues # diff --git a/lib/github_changelog_generator/generator/generator_fetcher.rb b/lib/github_changelog_generator/generator/generator_fetcher.rb index 3b15769..1a67db7 100644 --- a/lib/github_changelog_generator/generator/generator_fetcher.rb +++ b/lib/github_changelog_generator/generator/generator_fetcher.rb @@ -17,8 +17,8 @@ module GitHubChangelogGenerator # Async fetching tags: threads = [] i = 0 - all = @all_tags.count - @all_tags.each do |tag| + all = @filtered_tags.count + @filtered_tags.each do |tag| print " \r" threads << Thread.new do @fetcher.get_time_of_tag(tag) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index 5571359..75691be 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -131,7 +131,7 @@ module GitHubChangelogGenerator (1...all_tags.size).each do |index| log += generate_log_between_tags(all_tags[index], all_tags[index - 1]) end - if @all_tags.count != 0 + if @filtered_tags.count != 0 log += generate_log_between_tags(nil, all_tags.last) end diff --git a/lib/github_changelog_generator/generator/generator_processor.rb b/lib/github_changelog_generator/generator/generator_processor.rb index f95142c..b56a498 100644 --- a/lib/github_changelog_generator/generator/generator_processor.rb +++ b/lib/github_changelog_generator/generator/generator_processor.rb @@ -36,7 +36,7 @@ module GitHubChangelogGenerator false else # check, that this milestone in tag list: - milestone_is_tag = @all_tags.find do |tag| + milestone_is_tag = @filtered_tags.find do |tag| tag.name == issue.milestone.title end @@ -57,7 +57,7 @@ module GitHubChangelogGenerator true else # check, that this milestone in tag list: - @all_tags.find { |tag| tag.name == issue.milestone.title }.nil? + @filtered_tags.find { |tag| tag.name == issue.milestone.title }.nil? end end end diff --git a/lib/github_changelog_generator/generator/generator_tags.rb b/lib/github_changelog_generator/generator/generator_tags.rb index 6873c10..adbd504 100644 --- a/lib/github_changelog_generator/generator/generator_tags.rb +++ b/lib/github_changelog_generator/generator/generator_tags.rb @@ -2,15 +2,15 @@ module GitHubChangelogGenerator class Generator # fetch, filter tags, fetch dates and sort them in time order def fetch_and_filter_tags - @all_tags = get_filtered_tags(@fetcher.get_all_tags) + @filtered_tags = get_filtered_tags(@fetcher.get_all_tags) fetch_tags_dates - sort_tags_by_date + sort_tags_by_date(@filtered_tags) end # Sort all tags by date - def sort_tags_by_date + def sort_tags_by_date(tags) puts "Sorting tags..." if @options[:verbose] - @all_tags.sort_by! { |x| @fetcher.get_time_of_tag(x) }.reverse! + tags.sort_by! { |x| @fetcher.get_time_of_tag(x) }.reverse! end # Detect link, name and time for specified tag.