[release] add stats to changelog

This commit is contained in:
geemus 2011-08-09 11:23:42 -05:00
parent de80fc1c8c
commit 8c2a5aacae
1 changed files with 12 additions and 0 deletions

View File

@ -191,6 +191,18 @@ task :changelog do
changelog << ('=' * changelog[0].length)
changelog << ''
require 'multi_json'
github_data = MultiJson.decode(Excon.get('http://github.com/api/v2/json/repos/show/geemus/fog').body)
data = github_data['repository'].reject {|key, value| !['forks', 'open_issues', 'watchers'].include?(key)}
rubygems_data = MultiJson.decode(Excon.get('https://rubygems.org/api/v1/gems/fog.json').body)
data['downloads'] = rubygems_data['downloads']
stats = []
for key in data.keys.sort
stats << "'#{key}' => #{data[key]}"
end
changelog << "Stats! { #{stats.join(', ')} }"
changelog << ''
last_sha = `cat changelog.txt | head -1`.split(' ').last
shortlog = `git shortlog #{last_sha}..HEAD`
changes = {}