Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: octokit/octokit.rb
base: a73279b27d
...
head fork: octokit/octokit.rb
compare: 251f1070b4
  • 7 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
7 lib/octokit/client/organizations.rb
View
@@ -84,6 +84,13 @@ def remove_team_repository(team_id, repo, options={})
end
alias :remove_team_repo :remove_team_repository
+ def remove_organization_member(org, user, options={})
+ # this is a synonym for: for team in org.teams: remove_team_member(team.id, user)
+ # provided in the GH API v3
+ delete("orgs/#{org}/members/#{user}", options, 3, true, raw=true).status == 204
+ end
+ alias :remove_org_member :remove_organization_member
+
def publicize_membership(org, user, options={})
put("orgs/#{org}/public_members/#{user}", options, 3, true, raw=true).status == 204
end
2  lib/octokit/client/repositories.rb
View
@@ -60,10 +60,12 @@ def delete_repository(repo, options={})
alias :delete_repo :delete_repository
def set_private(repo, options={})
+ # GitHub Api for setting private updated to use private attr, rather than public
update_repository repo, options.merge({ :private => true })
end
def set_public(repo, options={})
+ # GitHub Api for setting private updated to use private attr, rather than public
update_repository repo, options.merge({ :private => false })
end
9 spec/octokit/client/organizations_spec.rb
View
@@ -170,6 +170,15 @@
end
+ describe ".remove_organization_member" do
+ it "should remove a member from an organization" do
+ stub_delete("https://api.github.com/orgs/codeforamerica/members/glow-mdsol").
+ to_return(:status => 204)
+ result = @client.remove_organization_member("codeforamerica", "glow-mdsol")
+ result.should be_true
+ end
+
+ end
describe ".team_repositories" do
it "should return team repositories" do

No commit comments for this range

Something went wrong with that request. Please try again.