Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
You laugh at me, you bastard, and I'll shoot you where you stand.
Ruby
tag: 0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
features
lib
test
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
enforcer.gemspec

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.

Something went wrong with that request. Please try again.