Skip to content

Instantly share code, notes, and snippets.

@sr
Created October 30, 2008 17:23
Show Gist options
  • Save sr/21087 to your computer and use it in GitHub Desktop.
Save sr/21087 to your computer and use it in GitHub Desktop.
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