Skip to content

Instantly share code, notes, and snippets.

@stevenheidel
Created August 26, 2010 22:26
Show Gist options
  • Save stevenheidel/552382 to your computer and use it in GitHub Desktop.
Save stevenheidel/552382 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'octopi'
include Octopi
project2 = "resolve/refinerycms"
project1 = "radiant/radiant"
def toolbox_score(path)
repo = Repository.find(:user => path.split("/").first, :repo => path.split("/").last)
score = repo.forks * 4 + repo.watchers
score.to_f
end
if (proportion = toolbox_score(project1) / toolbox_score(project2)) > 1
proportion **= -1
project1, project2 = project2, project1
end
puts "\nComparing #{project1} with #{project2}:"
puts "=> " + ((proportion * 10000).round / 100.0).to_s + "%"
@resolve
Copy link

resolve commented Aug 26, 2010

this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment