Created
July 1, 2010 01:58
-
-
Save stevenheidel/459454 to your computer and use it in GitHub Desktop.
Used to generate the initial refinerycms changelog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'octopi' | |
include Octopi | |
refinerycms = {:user => "resolve", :repo => "refinerycms"} | |
tags = Tag.all(refinerycms) | |
puts "Getting tags.........." | |
tags.map! do |tag| | |
sha = {:sha => tag.sha} | |
newtag = {:version => tag.name} | |
date = Commit.find(refinerycms.merge(sha)).committed_date | |
date = Time.parse(date) | |
puts newtag[:version] | |
tag = {:version => tag.name, :date => date} | |
end | |
puts "Done!" | |
File.open("CHANGELOG", "w") do |f| | |
tags.sort{|a,b| a[:date] <=> b[:date]}.reverse.each do |tag| | |
f.puts "===#{tag[:version]} [#{tag[:date].strftime('%d %B %Y')}]" | |
f.puts "\n" | |
if tag[:version].split('.').count == 4 | |
f.puts "- Bugfixes." | |
else | |
f.puts "- Minor release." | |
end | |
f.puts "\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment