From 4931383fd2ec98b39b2ceaeeefc40ea251c2b9f5 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 5 Nov 2014 18:39:39 +0200 Subject: [PATCH] named putput file --- .gitignore | 3 +-- changelog_generator.rb | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4531204..a64bd12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -output.txt constants.rb -output.md +*.md diff --git a/changelog_generator.rb b/changelog_generator.rb index 91e250d..1df0d93 100755 --- a/changelog_generator.rb +++ b/changelog_generator.rb @@ -52,8 +52,8 @@ class ChangelogGenerator if @options[:verbose] puts 'Generating changelog:' end - log = '# Changelog' + log = "# Changelog\n\n----\n\n" if @options[:last] log += self.generate_log_between_tags(self.all_tags[0], self.all_tags[1]) @@ -82,8 +82,15 @@ class ChangelogGenerator log += self.generate_log_for_all_tags end - puts log - File.open('output.md', 'w') { |file| file.write(log) } + + if @options[:verbose] + puts log + end + + output_filename = "#{$github_repo_name}_changelog.md" + File.open(output_filename, 'w') { |file| file.write(log) } + + puts "Done! Generated log placed in #{output_filename}" end