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
+1 -2
View File
@@ -1,3 +1,2 @@
output.txt
constants.rb
output.md
*.md
+10 -3
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
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