Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 26 lines (20 sloc) 0.496 kb
4aeb4b3 @coreyhaines Plenty of confusion since either fakeweb or github is being a pain
coreyhaines authored
1 $:.unshift(File.dirname(__FILE__))
2861d65 @coreyhaines Fleshing out some features and starting on the tests
coreyhaines authored
2 require 'github_api'
493248e @coreyhaines Making binding work and figuring out more of the DSL
coreyhaines authored
3
4 class Enforcer
4aeb4b3 @coreyhaines Plenty of confusion since either fakeweb or github is being a pain
coreyhaines authored
5 def initialize(user_name)
6 end
493248e @coreyhaines Making binding work and figuring out more of the DSL
coreyhaines authored
7
8 def project(project_name, &block)
9 instance_eval(&block)
10 return if @collaborators.nil?
11
12 @collaborators.each do |collaborator|
13 GitHubApi.add_collaborator(project_name, collaborator)
14 end
15 end
16
17 def collaborators(*names)
18 @collaborators = names
19 end
20 end
4aeb4b3 @coreyhaines Plenty of confusion since either fakeweb or github is being a pain
coreyhaines authored
21
22 def Enforcer(user_name, &block)
23 enforcer = Enforcer.new(user_name)
24 enforcer.instance_eval(&block)
25 end
Something went wrong with that request. Please try again.