Module: Octokit::Client::Repositories
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/repositories.rb
Instance Method Summary collapse
- #add_collaborator(repo, collaborator, options = {}) ⇒ Object (also: #add_collab)
- #add_deploy_key(repo, title, key, options = {}) ⇒ Object
- #branches(repo, options = {}) ⇒ Object
- #collaborators(repo, options = {}) ⇒ Object (also: #collabs)
- #contributors(repo, anon = false, options = {}) ⇒ Object (also: #contribs)
- #create_repository(name, options = {}) ⇒ Object (also: #create_repo, #create)
- #delete_repository(repo, options = {}) ⇒ Object (also: #delete_repo)
- #delete_repository!(repo, options = {}) ⇒ Object (also: #delete_repo!)
- #deploy_keys(repo, options = {}) ⇒ Object (also: #list_deploy_keys)
- #fork(repo, options = {}) ⇒ Object
- #languages(repo, options = {}) ⇒ Object
- #network(repo, options = {}) ⇒ Object
- #pushable(options = {}) ⇒ Object
- #remove_collaborator(repo, collaborator, options = {}) ⇒ Object (also: #remove_collab)
- #remove_deploy_key(repo, id, options = {}) ⇒ Object
- #repositories(username = login, options = {}) ⇒ Object (also: #list_repositories, #list_repos, #repos)
- #repository(repo, options = {}) ⇒ Object (also: #repo)
- #repository_teams(repo, options = {}) ⇒ Object (also: #repo_teams, #teams)
- #search_repositories(q, options = {}) ⇒ Object (also: #search_repos)
- #set_private(repo, options = {}) ⇒ Object
- #set_public(repo, options = {}) ⇒ Object
- #tags(repo, options = {}) ⇒ Object
- #unwatch(repo, options = {}) ⇒ Object
- #update_repository(repo, values, options = {}) ⇒ Object (also: #update_repo)
- #watch(repo, options = {}) ⇒ Object
- #watchers(repo, options = {}) ⇒ Object
Instance Method Details
#add_collaborator(repo, collaborator, options = {}) ⇒ Object Also known as: add_collab
87 88 89 |
# File 'lib/octokit/client/repositories.rb', line 87 def add_collaborator(repo, collaborator, ={}) post("repos/collaborators/#{Repository.new(repo)}/add/#{collaborator}")['collaborators'] end |
#add_deploy_key(repo, title, key, options = {}) ⇒ Object
74 75 76 |
# File 'lib/octokit/client/repositories.rb', line 74 def add_deploy_key(repo, title, key, ={}) post("repos/key/#{Repository.new(repo)}/add", )['public_keys'] end |
#branches(repo, options = {}) ⇒ Object
132 133 134 |
# File 'lib/octokit/client/repositories.rb', line 132 def branches(repo, ={}) get("repos/show/#{Repository.new(repo)}/branches", )['branches'] end |
#collaborators(repo, options = {}) ⇒ Object Also known as: collabs
82 83 84 |
# File 'lib/octokit/client/repositories.rb', line 82 def collaborators(repo, ={}) get("repos/show/#{Repository.new(repo)}/collaborators", )['collaborators'] end |
#contributors(repo, anon = false, options = {}) ⇒ Object Also known as: contribs
107 108 109 110 111 112 113 |
# File 'lib/octokit/client/repositories.rb', line 107 def contributors(repo, anon=false, ={}) if anon get("repos/show/#{Repository.new(repo)}/contributors/anon", ) else get("repos/show/#{Repository.new(repo)}/contributors", ) end['contributors'] end |
#create_repository(name, options = {}) ⇒ Object Also known as: create_repo, create
39 40 41 |
# File 'lib/octokit/client/repositories.rb', line 39 def create_repository(name, ={}) post("repos/create", .merge(:name => name))['repository'] end |
#delete_repository(repo, options = {}) ⇒ Object Also known as: delete_repo
45 46 47 48 49 50 51 52 |
# File 'lib/octokit/client/repositories.rb', line 45 def delete_repository(repo, ={}) response = post("repos/delete/#{Repository.new(repo)}", ) if response.respond_to?(:delete_token) response['delete_token'] else response['repository'] end end |
#delete_repository!(repo, options = {}) ⇒ Object Also known as: delete_repo!
55 56 57 58 |
# File 'lib/octokit/client/repositories.rb', line 55 def delete_repository!(repo, ={}) response = post("repos/delete/#{Repository.new(repo)}", ) post("repos/delete/#{Repository.new(repo)}", .merge(:delete_token => response['delete_token']))['repository'] end |
#deploy_keys(repo, options = {}) ⇒ Object Also known as: list_deploy_keys
69 70 71 |
# File 'lib/octokit/client/repositories.rb', line 69 def deploy_keys(repo, ={}) get("repos/keys/#{Repository.new(repo)}", )['public_keys'] end |
#fork(repo, options = {}) ⇒ Object
35 36 37 |
# File 'lib/octokit/client/repositories.rb', line 35 def fork(repo, ={}) post("repos/fork/#{Repository.new(repo)}", )['repository'] end |
#languages(repo, options = {}) ⇒ Object
124 125 126 |
# File 'lib/octokit/client/repositories.rb', line 124 def languages(repo, ={}) get("repos/show/#{Repository.new(repo)}/languages", )['languages'] end |
#network(repo, options = {}) ⇒ Object
120 121 122 |
# File 'lib/octokit/client/repositories.rb', line 120 def network(repo, ={}) get("repos/show/#{Repository.new(repo)}/network", )['network'] end |
#pushable(options = {}) ⇒ Object
97 98 99 |
# File 'lib/octokit/client/repositories.rb', line 97 def pushable(={}) get("repos/pushable", )['repositories'] end |
#remove_collaborator(repo, collaborator, options = {}) ⇒ Object Also known as: remove_collab
92 93 94 |
# File 'lib/octokit/client/repositories.rb', line 92 def remove_collaborator(repo, collaborator, ={}) post("repos/collaborators/#{Repository.new(repo)}/remove/#{collaborator}")['collaborators'] end |
#remove_deploy_key(repo, id, options = {}) ⇒ Object
78 79 80 |
# File 'lib/octokit/client/repositories.rb', line 78 def remove_deploy_key(repo, id, ={}) post("repos/key/#{Repository.new(repo)}/remove", .merge(:id => id))['public_keys'] end |
#repositories(username = login, options = {}) ⇒ Object Also known as: list_repositories, list_repos, repos
20 21 22 |
# File 'lib/octokit/client/repositories.rb', line 20 def repositories(username=login, ={}) get(["repos/show", username].compact.join('/'), )['repositories'] end |
#repository(repo, options = {}) ⇒ Object Also known as: repo
10 11 12 |
# File 'lib/octokit/client/repositories.rb', line 10 def repository(repo, ={}) get("repos/show/#{Repository.new(repo)}", )['repository'] end |
#repository_teams(repo, options = {}) ⇒ Object Also known as: repo_teams, teams
101 102 103 |
# File 'lib/octokit/client/repositories.rb', line 101 def repository_teams(repo, ={}) get("repos/show/#{Repository.new(repo)}/teams", )['teams'] end |
#search_repositories(q, options = {}) ⇒ Object Also known as: search_repos
5 6 7 |
# File 'lib/octokit/client/repositories.rb', line 5 def search_repositories(q, ={}) get("repos/search/#{q}", )['repositories'] end |
#set_private(repo, options = {}) ⇒ Object
61 62 63 |
# File 'lib/octokit/client/repositories.rb', line 61 def set_private(repo, ={}) post("repos/set/private/#{Repository.new(repo)}", )['repository'] end |
#set_public(repo, options = {}) ⇒ Object
65 66 67 |
# File 'lib/octokit/client/repositories.rb', line 65 def set_public(repo, ={}) post("repos/set/public/#{Repository.new(repo)}", )['repository'] end |
#tags(repo, options = {}) ⇒ Object
128 129 130 |
# File 'lib/octokit/client/repositories.rb', line 128 def (repo, ={}) get("repos/show/#{Repository.new(repo)}/tags", )['tags'] end |
#unwatch(repo, options = {}) ⇒ Object
31 32 33 |
# File 'lib/octokit/client/repositories.rb', line 31 def unwatch(repo, ={}) post("repos/unwatch/#{Repository.new(repo)}", )['repository'] end |
#update_repository(repo, values, options = {}) ⇒ Object Also known as: update_repo
15 16 17 |
# File 'lib/octokit/client/repositories.rb', line 15 def update_repository(repo, values, ={}) post("repos/show/#{Repository.new(repo)}", .merge({:values => values}))['repository'] end |
#watch(repo, options = {}) ⇒ Object
27 28 29 |
# File 'lib/octokit/client/repositories.rb', line 27 def watch(repo, ={}) post("repos/watch/#{Repository.new(repo)}", )['repository'] end |
#watchers(repo, options = {}) ⇒ Object
116 117 118 |
# File 'lib/octokit/client/repositories.rb', line 116 def watchers(repo, ={}) get("repos/show/#{Repository.new(repo)}/watchers", )['watchers'] end |