Merge branch 'dev/no_replace' of https://github.com/raphink/github-changelog-generator into raphink-dev/no_replace

This commit is contained in:
Petr Korolev
2015-08-24 14:43:05 +03:00
4 changed files with 23 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ module GitHubChangelogGenerator
log += generate_log_for_all_tags
end
log += File.read(@options[:base]) if File.file?(@options[:base])
log += "\n\n\\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
@log = log
end

View File

@@ -52,6 +52,14 @@ module GitHubChangelogGenerator
[newer_tag_link, newer_tag_name, newer_tag_time]
end
def detect_since_tag
if @options[:base] && File.file?(@options[:base])
reader = GitHubChangelogGenerator::Reader.new
content = reader.read(@options[:base])
return content[0]["version"] if content
end
end
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
#
# @return [Array]
@@ -64,6 +72,7 @@ module GitHubChangelogGenerator
def filter_since_tag(all_tags)
filtered_tags = all_tags
tag = @options[:since_tag]
tag ||= detect_since_tag
if tag
if all_tags.map(&:name).include? tag
idx = all_tags.index { |t| t.name == tag }