public
Description: You laugh at me, you bastard, and I'll shoot you where you stand.
Homepage:
Clone URL: git://github.com/thoughtbot/enforcer.git
name age message
file .document Mon Jul 13 06:26:03 -0700 2009 Initial commit to enforcer. [qrush]
file .gitignore Mon Jul 13 06:26:03 -0700 2009 Initial commit to enforcer. [qrush]
file LICENSE Mon Jul 13 06:31:49 -0700 2009 This is totally not my fault [qrush]
file README.rdoc Mon Jul 20 08:03:37 -0700 2009 Updating the readme with some usage examples [qrush]
file Rakefile Mon Aug 24 08:12:23 -0700 2009 Adding dependencies in [qrush]
file VERSION Mon Aug 24 10:11:45 -0700 2009 bumping to 0.0.2 [qrush]
directory bin/ Mon Jul 20 08:18:13 -0700 2009 Whipping up a simple executable [qrush]
file enforcer.gemspec Mon Aug 24 10:11:45 -0700 2009 bumping to 0.0.2 [qrush]
directory features/ Tue Jul 14 06:31:21 -0700 2009 Making the DSL a bit more compact [qrush]
directory lib/ Mon Aug 24 10:09:15 -0700 2009 Adding some better error checking in [qrush]
directory test/ Mon Aug 24 10:09:15 -0700 2009 Adding some better error checking in [qrush]
README.rdoc

enforcer

A simple way to manage permissions on GitHub.

usage

Create an enforcer script and then run it with the "enforcer" executable.

  enforcer my_enforcer_script.rb

howto

The DSL should be formed like such:

  Enforcer "your github account", "your github api key" do
    project "some project", "user1", "user2", "user3"
  end

The users passed into the project are then set as the collaborators. Any users not listed are removed. You could use a GitHub API wrapper like Octopi to load up your projects as well. Here’s a more complex example:

  require 'octopi'
  include Octopi
  account = "thoughtbot"
  token   = "deadbeef"

  Enforcer account, token do
    authenticated_with account, token do |github|
      @projects = github.user.repositories.map { |repo| repo.name }.sort
    end

    users = %w[user1 user2 user3]

    @projects.each do |name|
      project name, *users
    end
  end

legal

Copyright © 2009 thoughtbot. See LICENSE for details.