named putput file

This commit is contained in:
Petr Korolev 2014-11-05 18:39:39 +02:00
parent 59f78a780d
commit 4931383fd2
2 changed files with 11 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,3 +1,2 @@
output.txt
constants.rb
output.md
*.md

View File

@ -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
if @options[:verbose]
puts log
File.open('output.md', 'w') { |file| file.write(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