Module: Octokit::Client::Repositories
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/repositories.rb |
Overview
Methods for the Repositories
API
Instance Method Summary
-
#add_collab(repo, collaborator, options = {})
Alias for #add_collaborator.
-
#add_collaborator(repo, collaborator, options = {}) ⇒ Boolean
(also: #add_collab)
Add collaborator to repo.
-
#add_deploy_key(repo, title, key, options = {}) ⇒ Sawyer::Resource
Add deploy key to a repo.
-
#all_repositories(options = {}) ⇒ Array<Sawyer::Resource>
List all repositories.
-
#automated_security_fixes_enabled?(repo, options = {}) ⇒ Boolean
Check to see if automated security fixes are enabled for a repository.
-
#branch(repo, branch, options = {}) ⇒ Sawyer::Resource
(also: #get_branch)
Get a single branch from a repository.
-
#branch_protection(repo, branch, options = {}) ⇒ Sawyer::Resource?
Get branch protection summary.
-
#branches(repo, options = {}) ⇒ Array<Sawyer::Resource>
List branches.
-
#check_assignee(repo, assignee, options = {}) ⇒ Boolean
Check to see if a particular user is an assignee for a repository.
-
#collaborator?(repo, collaborator, options = {}) ⇒ Boolean
Checks
if a user is a collaborator for a repo. -
#collaborators(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #collabs)
List collaborators.
-
#collabs(repo, options = {})
Alias for #collaborators.
-
#contribs(repo, anon = nil, options = {})
Alias for #contributors.
-
#contributors(repo, anon = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #contribs)
List contributors to a repo.
-
#create(name, options = {})
Alias for #create_repository.
-
#create_repo(name, options = {})
Alias for #create_repository.
-
#create_repo_from_template(repo, name, options = {})
Alias for #create_repository_from_template.
-
#create_repository(name, options = {}) ⇒ Sawyer::Resource
(also: #create_repo, #create)
Create a repository for a user or organization.
-
#create_repository_from_template(repo, name, options = {}) ⇒ Sawyer::Resource
(also: #create_repo_from_template)
Create a repository for a user or organization generated from a template repository.
-
#delete_repo(repo, options = {})
Alias for #delete_repository.
-
#delete_repository(repo, options = {}) ⇒ Boolean
(also: #delete_repo)
Delete repository.
-
#delete_subscription(repo, options = {}) ⇒ Boolean
Delete a repository subscription.
-
#deploy_key(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single deploy key for a repo.
-
#deploy_keys(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_deploy_keys)
Get deploy keys on a repo.
-
#disable_automated_security_fixes(repo, options = {}) ⇒ Boolean
Disable automated security fixes for a repository.
-
#disable_vulnerability_alerts(repo, options = {}) ⇒ Boolean
Disable vulnerability alerts for a repository.
-
#dispatch_event(repo, event_type, options = {}) ⇒ Boolean
Create a repository dispatch event.
-
#edit(repo, options = {})
Alias for #edit_repository.
-
#edit_deploy_key(repo, id, options) ⇒ Sawyer::Resource
(also: #update_deploy_key)
deprecated
Deprecated.
This method is no longer supported in the API
-
#edit_repository(repo, options = {}) ⇒ Sawyer::Resource
(also: #edit, #update_repository, #update)
Edit a repository.
-
#enable_automated_security_fixes(repo, options = {}) ⇒ Boolean
Enable automated security fixes for a repository.
-
#enable_vulnerability_alerts(repo, options = {}) ⇒ Boolean
Enable vulnerability alerts for a repository.
-
#fork(repo, options = {}) ⇒ Sawyer::Resource
Fork a repository.
-
#forks(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #network)
List forks.
-
#get_branch(repo, branch, options = {})
Alias for #branch.
-
#languages(repo, options = {}) ⇒ Array<Sawyer::Resource>
List languages of code in the repo.
-
#list_deploy_keys(repo, options = {})
Alias for #deploy_keys.
-
#list_repos(user = nil, options = {})
Alias for #repositories.
-
#list_repositories(user = nil, options = {})
Alias for #repositories.
-
#network(repo, options = {})
Alias for #forks.
-
#permission_level(repo, collaborator, options = {}) ⇒ Sawyer::Resource
Get a user's permission level for a repo.
-
#protect_branch(repo, branch, options = {}) ⇒ Sawyer::Resource
Lock a single branch from a repository.
-
#remove_collab(repo, collaborator, options = {})
Alias for #remove_collaborator.
-
#remove_collaborator(repo, collaborator, options = {}) ⇒ Boolean
(also: #remove_collab)
Remove collaborator from repo.
-
#remove_deploy_key(repo, id, options = {}) ⇒ Boolean
Remove deploy key from a repo.
-
#rename_branch(repo, branch, new_name, options = {}) ⇒ Sawyer::Resource
Rename a single branch from a repository.
-
#replace_all_topics(repo, names, options = {}) ⇒ Sawyer::Resource
Replace all topics for a repository.
-
#repo(repo, options = {})
Alias for #repository.
-
#repo_assignees(repo, options = {})
Alias for #repository_assignees.
-
#repo_teams(repo, options = {})
Alias for #repository_teams.
-
#repos(user = nil, options = {})
Alias for #repositories.
-
#repositories(user = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_repositories, #list_repos, #repos)
List user repositories.
-
#repository(repo, options = {}) ⇒ Sawyer::Resource
(also: #repo)
Get a single repository.
-
#repository?(repo, options = {}) ⇒ Boolean
Check if a repository exists.
-
#repository_assignees(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #repo_assignees)
List users available for assigning to issues.
-
#repository_teams(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #repo_teams, #teams)
List teams for a repo.
-
#set_private(repo, options = {}) ⇒ Sawyer::Resource
Hide a public repository.
-
#set_public(repo, options = {}) ⇒ Sawyer::Resource
Unhide a private repository.
-
#star(repo, options = {}) ⇒ Boolean
Star a repository.
-
#stargazers(repo, options = {}) ⇒ Array<Sawyer::Resource>
List stargazers of a repo.
-
#subscribers(repo, options = {}) ⇒ Array<Sawyer::Resource>
List watchers subscribing to notifications for a repo.
-
#subscription(repo, options = {}) ⇒ Sawyer::Resource
Get a repository subscription.
-
#tags(repo, options = {}) ⇒ Array<Sawyer::Resource>
List tags.
-
#teams(repo, options = {})
Alias for #repository_teams.
-
#topics(repo, options = {}) ⇒ Sawyer::Resource
List all topics for a repository.
-
#transfer_repo(repo, new_owner, options = {})
Alias for #transfer_repository.
-
#transfer_repository(repo, new_owner, options = {}) ⇒ Sawyer::Resource
(also: #transfer_repo)
Transfer repository.
-
#unprotect_branch(repo, branch, options = {}) ⇒ Sawyer::Resource
Unlock a single branch from a repository.
-
#unstar(repo, options = {}) ⇒ Boolean
Unstar a repository.
-
#unwatch(repo, options = {}) ⇒ Boolean
deprecated
Deprecated.
Use #unstar instead
-
#update(repo, options = {})
Alias for #edit_repository.
-
#update_deploy_key(repo, id, options)
Alias for #edit_deploy_key.
-
#update_repository(repo, options = {})
Alias for #edit_repository.
-
#update_subscription(repo, options = {}) ⇒ Sawyer::Resource
Update repository subscription.
-
#vulnerability_alerts_enabled?(repo, options = {}) ⇒ Boolean
Check to see if vulnerability alerts are enabled for a repository.
-
#watch(repo, options = {}) ⇒ Boolean
deprecated
Deprecated.
Use #star instead
-
#watchers(repo, options = {}) ⇒ Array<Sawyer::Resource>
deprecated
Deprecated.
Use #stargazers instead
Instance Method Details
#add_collab(repo, collaborator, options = {})
Alias for #add_collaborator.
# File 'lib/octokit/client/repositories.rb', line 348
alias add_collab add_collaborator
#add_collaborator(repo, collaborator, options = {}) ⇒ Boolean
Also known as: #add_collab
Add collaborator to repo
This can also be used to update the permission of an existing collaborator
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 345
def add_collaborator(repo, collaborator, = {}) boolean_from_response :put, "#{Repository.path repo}/collaborators/#{collaborator}", end
#add_deploy_key(repo, title, key, options = {}) ⇒ Sawyer::Resource
Add deploy key to a repo
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 266
def add_deploy_key(repo, title, key, = {}) post "#{Repository.path repo}/keys", .merge(title: title, key: key) end
#all_repositories(options = {}) ⇒ Array
<Sawyer::Resource
>
List all repositories
This provides a dump of every repository, in the order that they were created.
# File 'lib/octokit/client/repositories.rb', line 87
def all_repositories( = {}) paginate 'repositories', end
#automated_security_fixes_enabled?(repo, options = {}) ⇒ Boolean
Check to see if automated security fixes are enabled for a repository
The authenticated user must have admin access to the repository.
# File 'lib/octokit/client/repositories.rb', line 788
def automated_security_fixes_enabled?(repo, = {}) response = get "#{Repository.path repo}/automated-security-fixes", return response[:enabled] if @last_response.status == 200 false end
#branch(repo, branch, options = {}) ⇒ Sawyer::Resource
Also known as: #get_branch
Get a single branch from a repository
# File 'lib/octokit/client/repositories.rb', line 566
def branch(repo, branch, = {}) get "#{Repository.path repo}/branches/#{CGI.escape(branch)}", end
#branch_protection(repo, branch, options = {}) ⇒ Sawyer::Resource
?
Get branch protection summary
# File 'lib/octokit/client/repositories.rb', line 606
def branch_protection(repo, branch, = {}) get "#{Repository.path repo}/branches/#{branch}/protection", rescue Octokit::BranchNotProtected nil end
#branches(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
List branches
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 554
def branches(repo, = {}) paginate "#{Repository.path repo}/branches", end
#check_assignee(repo, assignee, options = {}) ⇒ Boolean
Check to see if a particular user is an assignee for a repository.
# File 'lib/octokit/client/repositories.rb', line 670
def check_assignee(repo, assignee, = {}) boolean_from_response :get, "#{Repository.path repo}/assignees/#{assignee}", end
#collaborator?(repo, collaborator, options = {}) ⇒ Boolean
Checks
if a user is a collaborator for a repo.
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 377
def collaborator?(repo, collaborator, = {}) boolean_from_response :get, "#{Repository.path repo}/collaborators/#{collaborator}", end
#collaborators(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #collabs
List collaborators
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 320
def collaborators(repo, = {}) paginate "#{Repository.path repo}/collaborators", end
#collabs(repo, options = {})
Alias for #collaborators.
# File 'lib/octokit/client/repositories.rb', line 323
alias collabs collaborators
#contribs(repo, anon = nil, options = {})
Alias for #contributors.
# File 'lib/octokit/client/repositories.rb', line 461
alias contribs contributors
#contributors(repo, anon = nil, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #contribs
List contributors to a repo
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 457
def contributors(repo, anon = nil, = {}) [:anon] = 1 if anon.to_s[/1|true/] paginate "#{Repository.path repo}/contributors", end
#create(name, options = {})
Alias for #create_repository.
# File 'lib/octokit/client/repositories.rb', line 166
alias create create_repository
#create_repo(name, options = {})
Alias for #create_repository.
# File 'lib/octokit/client/repositories.rb', line 165
alias create_repo create_repository
#create_repo_from_template(repo, name, options = {})
Alias for #create_repository_from_template.
# File 'lib/octokit/client/repositories.rb', line 207
alias create_repo_from_template create_repository_from_template
#create_repository(name, options = {}) ⇒ Sawyer::Resource
Also known as: #create_repo, #create
Create a repository for a user or organization
# File 'lib/octokit/client/repositories.rb', line 154
def create_repository(name, = {}) opts = .dup organization = opts.delete :organization opts.merge! name: name if organization.nil? post 'user/repos', opts else post "#{Organization.path organization}/repos", opts end end
#create_repository_from_template(repo, name, options = {}) ⇒ Sawyer::Resource
Also known as: #create_repo_from_template
Create a repository for a user or organization generated from a template repository
# File 'lib/octokit/client/repositories.rb', line 203
def create_repository_from_template(repo, name, = {}) .merge! name: name post "#{Repository.path repo}/generate", end
#delete_repo(repo, options = {})
Alias for #delete_repository.
# File 'lib/octokit/client/repositories.rb', line 178
alias delete_repo delete_repository
#delete_repository(repo, options = {}) ⇒ Boolean
Also known as: #delete_repo
Delete repository
Note: If OAuth is used, 'delete_repo' scope is required
# File 'lib/octokit/client/repositories.rb', line 175
def delete_repository(repo, = {}) boolean_from_response :delete, Repository.path(repo), end
#delete_subscription(repo, options = {}) ⇒ Boolean
Delete a repository subscription
# File 'lib/octokit/client/repositories.rb', line 721
def delete_subscription(repo, = {}) boolean_from_response :delete, "#{Repository.path repo}/subscription", end
#deploy_key(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single deploy key for a repo
# File 'lib/octokit/client/repositories.rb', line 251
def deploy_key(repo, id, = {}) get "#{Repository.path repo}/keys/#{id}", end
#deploy_keys(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #list_deploy_keys
Get deploy keys on a repo
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 238
def deploy_keys(repo, = {}) paginate "#{Repository.path repo}/keys", end
#disable_automated_security_fixes(repo, options = {}) ⇒ Boolean
Disable automated security fixes for a repository
# File 'lib/octokit/client/repositories.rb', line 817
def disable_automated_security_fixes(repo, = {}) boolean_from_response(:delete, "#{Repository.path repo}/automated-security-fixes", ) end
#disable_vulnerability_alerts(repo, options = {}) ⇒ Boolean
Disable vulnerability alerts for a repository
# File 'lib/octokit/client/repositories.rb', line 774
def disable_vulnerability_alerts(repo, = {}) boolean_from_response(:delete, "#{Repository.path repo}/vulnerability-alerts", ) end
#dispatch_event(repo, event_type, options = {}) ⇒ Boolean
Create a repository dispatch event
# File 'lib/octokit/client/repositories.rb', line 734
def dispatch_event(repo, event_type, = {}) boolean_from_response :post, "#{Repository.path repo}/dispatches", .merge({ event_type: event_type }) end
#edit(repo, options = {})
Alias for #edit_repository.
# File 'lib/octokit/client/repositories.rb', line 51
alias edit edit_repository
#edit_deploy_key(repo, id, options) ⇒ Sawyer::Resource
Also known as: #update_deploy_key
This method is no longer supported in the API
Edit a deploy key
# File 'lib/octokit/client/repositories.rb', line 285
def edit_deploy_key(repo, id, ) patch "#{Repository.path repo}/keys/#{id}", end
#edit_repository(repo, options = {}) ⇒ Sawyer::Resource
Also known as: #edit, #update_repository, #update
Edit a repository
#enable_automated_security_fixes(repo, options = {}) ⇒ Boolean
Enable automated security fixes for a repository
# File 'lib/octokit/client/repositories.rb', line 804
def enable_automated_security_fixes(repo, = {}) boolean_from_response(:put, "#{Repository.path repo}/automated-security-fixes", ) end
#enable_vulnerability_alerts(repo, options = {}) ⇒ Boolean
Enable vulnerability alerts for a repository
# File 'lib/octokit/client/repositories.rb', line 761
def enable_vulnerability_alerts(repo, = {}) boolean_from_response(:put, "#{Repository.path repo}/vulnerability-alerts", ) end
#fork(repo, options = {}) ⇒ Sawyer::Resource
Fork a repository
# File 'lib/octokit/client/repositories.rb', line 134
def fork(repo, = {}) post "#{Repository.path repo}/forks", end
#forks(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #network
List forks
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 508
def forks(repo, = {}) paginate "#{Repository.path repo}/forks", end
#get_branch(repo, branch, options = {})
Alias for #branch.
# File 'lib/octokit/client/repositories.rb', line 569
alias get_branch branch
#languages(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
List languages of code in the repo.
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 524
def languages(repo, = {}) paginate "#{Repository.path repo}/languages", end
#list_deploy_keys(repo, options = {})
Alias for #deploy_keys.
# File 'lib/octokit/client/repositories.rb', line 241
alias list_deploy_keys deploy_keys
#list_repos(user = nil, options = {})
Alias for #repositories.
# File 'lib/octokit/client/repositories.rb', line 73
alias list_repos repositories
#list_repositories(user = nil, options = {})
Alias for #repositories.
# File 'lib/octokit/client/repositories.rb', line 72
alias list_repositories repositories
#network(repo, options = {})
Alias for #forks.
# File 'lib/octokit/client/repositories.rb', line 511
alias network forks
#permission_level(repo, collaborator, options = {}) ⇒ Sawyer::Resource
Get a user's permission level for a repo.
Requires authenticated client
# File 'lib/octokit/client/repositories.rb', line 389
def (repo, collaborator, = {}) get "#{Repository.path repo}/collaborators/#{collaborator}/permission", end
#protect_branch(repo, branch, options = {}) ⇒ Sawyer::Resource
Lock a single branch from a repository
Requires authenticated client
#remove_collab(repo, collaborator, options = {})
Alias for #remove_collaborator.
# File 'lib/octokit/client/repositories.rb', line 365
alias remove_collab remove_collaborator
#remove_collaborator(repo, collaborator, options = {}) ⇒ Boolean
Also known as: #remove_collab
Remove collaborator from repo.
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 362
def remove_collaborator(repo, collaborator, = {}) boolean_from_response :delete, "#{Repository.path repo}/collaborators/#{collaborator}", end
#remove_deploy_key(repo, id, options = {}) ⇒ Boolean
Remove deploy key from a repo
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 300
def remove_deploy_key(repo, id, = {}) boolean_from_response :delete, "#{Repository.path repo}/keys/#{id}", end
#rename_branch(repo, branch, new_name, options = {}) ⇒ Sawyer::Resource
Rename a single branch from a repository
Requires authenticated client
#replace_all_topics(repo, names, options = {}) ⇒ Sawyer::Resource
Replace all topics for a repository
Requires authenticated client.
# File 'lib/octokit/client/repositories.rb', line 439
def replace_all_topics(repo, names, = {}) put "#{Repository.path repo}/topics", .merge(names: names) end
#repo(repo, options = {})
Alias for #repository.
# File 'lib/octokit/client/repositories.rb', line 29
alias repo repository
#repo_assignees(repo, options = {})
Alias for #repository_assignees.
# File 'lib/octokit/client/repositories.rb', line 660
alias repo_assignees repository_assignees
#repo_teams(repo, options = {})
Alias for #repository_teams.
# File 'lib/octokit/client/repositories.rb', line 409
alias repo_teams repository_teams
#repos(user = nil, options = {})
Alias for #repositories.
# File 'lib/octokit/client/repositories.rb', line 74
alias repos repositories
#repositories(user = nil, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #list_repositories, #list_repos, #repos
If the user provided is a GitHub organization, only the organization's public repositories will be listed. For retrieving organization repositories the Organizations#organization_repositories method should be used instead.
List user repositories
If user is not supplied, repositories for the current authenticated user are returned.
#repository(repo, options = {}) ⇒ Sawyer::Resource
Also known as: #repo
Get a single repository
# File 'lib/octokit/client/repositories.rb', line 26
def repository(repo, = {}) get Repository.path(repo), end
#repository?(repo, options = {}) ⇒ Boolean
Check if a repository exists
# File 'lib/octokit/client/repositories.rb', line 14
def repository?(repo, = {}) !!repository(repo, ) rescue Octokit::InvalidRepository, Octokit::NotFound false end
#repository_assignees(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #repo_assignees
List users available for assigning to issues.
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 657
def repository_assignees(repo, = {}) paginate "#{Repository.path repo}/assignees", end
#repository_teams(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #repo_teams, #teams
List teams for a repo
Requires authenticated client that is an owner or collaborator of the repo.
# File 'lib/octokit/client/repositories.rb', line 406
def repository_teams(repo, = {}) paginate "#{Repository.path repo}/teams", end
#set_private(repo, options = {}) ⇒ Sawyer::Resource
Hide a public repository
# File 'lib/octokit/client/repositories.rb', line 213
def set_private(repo, = {}) # GitHub Api for setting private updated to use private attr, rather than public update_repository repo, .merge({ private: true }) end
#set_public(repo, options = {}) ⇒ Sawyer::Resource
Unhide a private repository
# File 'lib/octokit/client/repositories.rb', line 222
def set_public(repo, = {}) # GitHub Api for setting private updated to use private attr, rather than public update_repository repo, .merge({ private: false }) end
#star(repo, options = {}) ⇒ Boolean
Star a repository
# File 'lib/octokit/client/repositories.rb', line 96
def star(repo, = {}) boolean_from_response :put, "user/starred/#{Repository.new(repo)}", end
#stargazers(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
List stargazers of a repo
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 474
def stargazers(repo, = {}) paginate "#{Repository.path repo}/stargazers", end
#subscribers(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
List watchers subscribing to notifications for a repo
# File 'lib/octokit/client/repositories.rb', line 681
def subscribers(repo, = {}) paginate "#{Repository.path repo}/subscribers", end
#subscription(repo, options = {}) ⇒ Sawyer::Resource
Get a repository subscription
# File 'lib/octokit/client/repositories.rb', line 692
def subscription(repo, = {}) get "#{Repository.path repo}/subscription", end
#tags(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
List tags
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 539
def (repo, = {}) paginate "#{Repository.path repo}/tags", end
#teams(repo, options = {})
Alias for #repository_teams.
# File 'lib/octokit/client/repositories.rb', line 410
alias teams repository_teams
#topics(repo, options = {}) ⇒ Sawyer::Resource
List all topics for a repository
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 423
def topics(repo, = {}) paginate "#{Repository.path repo}/topics", end
#transfer_repo(repo, new_owner, options = {})
Alias for #transfer_repository.
# File 'lib/octokit/client/repositories.rb', line 192
alias transfer_repo transfer_repository
#transfer_repository(repo, new_owner, options = {}) ⇒ Sawyer::Resource
Also known as: #transfer_repo
Transfer repository
Transfer a repository owned by your organization
# File 'lib/octokit/client/repositories.rb', line 189
def transfer_repository(repo, new_owner, = {}) post "#{Repository.path repo}/transfer", .merge({ new_owner: new_owner }) end
#unprotect_branch(repo, branch, options = {}) ⇒ Sawyer::Resource
Unlock a single branch from a repository
Requires authenticated client
#unstar(repo, options = {}) ⇒ Boolean
Unstar a repository
# File 'lib/octokit/client/repositories.rb', line 105
def unstar(repo, = {}) boolean_from_response :delete, "user/starred/#{Repository.new(repo)}", end
#unwatch(repo, options = {}) ⇒ Boolean
Use #unstar instead
Unwatch a repository
# File 'lib/octokit/client/repositories.rb', line 125
def unwatch(repo, = {}) boolean_from_response :delete, "user/watched/#{Repository.new(repo)}", end
#update(repo, options = {})
Alias for #edit_repository.
# File 'lib/octokit/client/repositories.rb', line 53
alias update edit_repository
#update_deploy_key(repo, id, options)
Alias for #edit_deploy_key.
# File 'lib/octokit/client/repositories.rb', line 288
alias update_deploy_key edit_deploy_key
#update_repository(repo, options = {})
Alias for #edit_repository.
# File 'lib/octokit/client/repositories.rb', line 52
alias update_repository edit_repository
#update_subscription(repo, options = {}) ⇒ Sawyer::Resource
Update repository subscription
# File 'lib/octokit/client/repositories.rb', line 709
def update_subscription(repo, = {}) put "#{Repository.path repo}/subscription", end
#vulnerability_alerts_enabled?(repo, options = {}) ⇒ Boolean
Check to see if vulnerability alerts are enabled for a repository
The authenticated user must have admin access to the repository.
# File 'lib/octokit/client/repositories.rb', line 748
def vulnerability_alerts_enabled?(repo, = {}) boolean_from_response(:get, "#{Repository.path repo}/vulnerability-alerts", ) end
#watch(repo, options = {}) ⇒ Boolean
Use #star instead
Watch a repository
# File 'lib/octokit/client/repositories.rb', line 115
def watch(repo, = {}) boolean_from_response :put, "user/watched/#{Repository.new(repo)}", end
#watchers(repo, options = {}) ⇒ Array
<Sawyer::Resource
>
Use #stargazers instead
List watchers of repo.
Requires authenticated client for private repos.
# File 'lib/octokit/client/repositories.rb', line 491
def watchers(repo, = {}) paginate "#{Repository.path repo}/watchers", end