Created
October 30, 2008 17:23
-
-
Save sr/21087 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'grit' | |
%w(saloon config couchy dst dumbapp git-wiki integrity).each do |repository| | |
repo = Grit::Repo.new(File.expand_path("~/code/#{repository}")) | |
commits = repo.log.collect { |commit| commit.message } | |
total_commits = commits.length.to_f | |
cosmetic_commits = commits.select { |message| message =~ /cosmetic/ }.length.to_f | |
puts <<-EOF | |
#{repository}: | |
total: #{total_commits.to_i} | |
comsetic commits: #{cosmetic_commits.to_i} | |
percentage: ~#{((cosmetic_commits/total_commits)*100).to_i}% | |
EOF | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment