enforcer and report_card

Nick Quaranto

Over the past few weeks I’ve been hard at work on some internal tools here at thoughtbot, and it’s due time that we brought them out for the community to enjoy as well. Without further ado…

enforcer

''

Since we’ve been hiring lately, we’ve had to set up new people with all of our projects on GitHub. Now that we’ve got 30+ repositories, this was starting to be a pain. Now, with enforcer, we’ve got a simple DSL to manage collaborators across all of them. Here’s a small example:

Enforcer "thoughtbot", "deadbeef" do
  project "shoulda", "sseagal", "jcvandamme", "cnorris"
end

This snippet will log in as thoughtbot using deadbeef as an API token, and then makes sure the three users listed are collaborators for shoulda. Anyone else that isn’t in the list given to the Enforcer is removed.

Check out more examples this, including getting all of your projects from the GitHub’s API, on the README.

report_card

Back in May I wrote about our metrics setup that used metric_fu and Integrity to whip up plenty of stats about how bad good our code is. A single script probably wasn’t going to be the best way to manage this over time, so we wanted to turn it into a real, tested library so we could trust in it and allow the community to use it with confidence as well.

''

Feel free to browse around our metrics site to see how it looks. report_card manages generating metric_fu sites for each project in Integrity along with creating the nice HTML front page and notifying Campfire of the difference in scores for each metric. Currently, we grade our projects every weekday morning so we can get a fresh look at the code coverage, smells, flog/flay scores, and more as the day starts. With the latest version of metric_fu we get graphs now too:

''

There’s plenty of information about how to install and configure your very own report_card on GitHub.

Visit our Open Source page to learn more about our team’s contributions.