lib/github_api/orgs/teams.rb in github_api-0.7.0 vs lib/github_api/orgs/teams.rb in github_api-0.7.1
- old
+ new
@@ -16,11 +16,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.list 'org-name'
#
def list(org_name, params={})
- _validate_presence_of org_name
+ assert_presence_of org_name
normalize! params
response = get_request("/orgs/#{org_name}/teams", params)
return response unless block_given?
response.each { |el| yield el }
@@ -32,11 +32,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.get 'team-id'
#
def get(team_id, params={})
- _validate_presence_of team_id
+ assert_presence_of team_id
normalize! params
get_request("/teams/#{team_id}", params)
end
alias :find :get
@@ -60,11 +60,11 @@
# "repo_names" => [
# "github/dotfiles"
# ]
#
def create(org_name, params={})
- _validate_presence_of org_name
+ assert_presence_of org_name
normalize! params
filter! VALID_TEAM_PARAM_NAMES, params
assert_valid_values(VALID_TEAM_PARAM_VALUES, params)
assert_required_keys(%w[ name ], params)
@@ -86,11 +86,11 @@
# github.orgs.teams.edit 'team-id',
# "name" => "new team name",
# "permission" => "push"
#
def edit(team_id, params={})
- _validate_presence_of team_id
+ assert_presence_of team_id
normalize! params
filter! VALID_TEAM_PARAM_NAMES, params
assert_valid_values(VALID_TEAM_PARAM_VALUES, params)
assert_required_keys(%w[ name ], params)
@@ -103,11 +103,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.delete 'team-id'
#
def delete(team_id, params={})
- _validate_presence_of team_id
+ assert_presence_of team_id
normalize! params
delete_request("/teams/#{team_id}", params)
end
alias :remove :delete
@@ -118,11 +118,11 @@
# github = Github.new :oauth_token => '...'
# github.orgs.teams.list_members 'team-id'
# github.orgs.teams.list_members 'team-id' { |member| ... }
#
def list_members(team_id, params={})
- _validate_presence_of team_id
+ assert_presence_of team_id
normalize! params
response = get_request("/teams/#{team_id}/members", params)
return response unless block_given?
response.each { |el| yield el }
@@ -134,11 +134,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.team_member? 'team-id', 'user-name'
#
def team_member?(team_id, member_name, params={})
- _validate_presence_of team_id, member_name
+ assert_presence_of team_id, member_name
normalize! params
get_request("/teams/#{team_id}/members/#{member_name}", params)
true
rescue Github::Error::NotFound
false
@@ -150,11 +150,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.add_member 'team-id', 'user-name'
#
def add_member(team_id, member_name, params={})
- _validate_presence_of team_id, member_name
+ assert_presence_of team_id, member_name
normalize! params
put_request("/teams/#{team_id}/members/#{member_name}", params)
end
alias :add_team_member :add_member
@@ -167,11 +167,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.remove_member 'team-id', 'member-name'
#
def remove_member(team_id, member_name, params={})
- _validate_presence_of team_id, member_name
+ assert_presence_of team_id, member_name
normalize! params
delete_request("/teams/#{team_id}/members/#{member_name}", params)
end
alias :remove_team_member :remove_member
@@ -180,11 +180,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.list_repos 'team-id'
#
def list_repos(team_id, params={})
- _validate_presence_of team_id
+ assert_presence_of team_id
normalize! params
response = get_request("/teams/#{team_id}/repos", params)
return response unless block_given?
response.each { |el| yield el }
@@ -196,11 +196,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.team_repo? 'team-id', 'user-name', 'repo-name'
#
def team_repo?(team_id, user_name, repo_name, params={})
- _validate_presence_of team_id, user_name, repo_name
+ assert_presence_of team_id, user_name, repo_name
normalize! params
get_request("/teams/#{team_id}/repos/#{user_name}/#{repo_name}", params)
true
rescue Github::Error::NotFound
false
@@ -217,11 +217,11 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.add_repo 'team-id', 'user-name', 'repo-name'
#
def add_repo(team_id, user_name, repo_name, params={})
- _validate_presence_of team_id, user_name, repo_name
+ assert_presence_of team_id, user_name, repo_name
normalize! params
put_request("/teams/#{team_id}/repos/#{user_name}/#{repo_name}", params)
end
alias :add_repository :add_repo
@@ -234,10 +234,10 @@
# = Examples
# github = Github.new :oauth_token => '...'
# github.orgs.teams.remove_repo 'team-id', 'user-name', 'repo-name'
#
def remove_repo(team_id, user_name, repo_name, params={})
- _validate_presence_of team_id, user_name, repo_name
+ assert_presence_of team_id, user_name, repo_name
normalize! params
delete_request("/teams/#{team_id}/repos/#{user_name}/#{repo_name}", params)
end
alias :remove_repository :remove_repo