From a0dce72151550938d87dcd2c5488e2ca7f03bc86 Mon Sep 17 00:00:00 2001 From: Roberto Romero Date: Thu, 30 Apr 2015 20:23:33 -0300 Subject: [PATCH] Fixes #1: Add future release option --- lib/github_changelog_generator.rb | 9 +++++++-- lib/github_changelog_generator/parser.rb | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index dd8c71c..ea7576c 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -388,8 +388,13 @@ module GitHubChangelogGenerator # @return [String] Ready and parsed section def create_log(pull_requests, issues, newer_tag, older_tag_name = nil) newer_tag_time = newer_tag.nil? ? Time.new : @fetcher.get_time_of_tag(newer_tag) - newer_tag_name = newer_tag.nil? ? @options[:unreleased_label] : newer_tag["name"] - newer_tag_link = newer_tag.nil? ? "HEAD" : newer_tag_name + if newer_tag.nil? && @options[:future_release] + newer_tag_name = @options[:future_release] + newer_tag_link = @options[:future_release] + else + newer_tag_name = newer_tag.nil? ? @options[:unreleased_label] : newer_tag["name"] + newer_tag_link = newer_tag.nil? ? "HEAD" : newer_tag_name + end github_site = options[:github_site] || "https://github.com" project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 8fce304..e1f9d87 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -98,6 +98,9 @@ module GitHubChangelogGenerator opts.on("--simple-list", "Create simple list from issues and pull requests. Default is false.") do |v| options[:simple_list] = v end + opts.on("--future-release [RELEASE-VERSION]", "Put the unreleased changes in the specified release number.") do |future_release| + options[:future_release] = future_release + end opts.on("--[no-]verbose", "Run verbosely. Default is true") do |v| options[:verbose] = v end