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
86 87 88 |
# File 'lib/octokit/client/repositories.rb', line 86 def add_collaborator(repo, collaborator, ={}) post("/api/v2/json/repos/collaborators/#{Repository.new(repo)}/add/#{collaborator}")['collaborators'] end |
#add_deploy_key(repo, title, key, options = {}) ⇒ Object
73 74 75 |
# File 'lib/octokit/client/repositories.rb', line 73 def add_deploy_key(repo, title, key, ={}) post("/api/v2/json/repos/key/#{Repository.new(repo)}/add", )['public_keys'] end |
#branches(repo, options = {}) ⇒ Object
131 132 133 |
# File 'lib/octokit/client/repositories.rb', line 131 def branches(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/branches", )['branches'] end |
#collaborators(repo, options = {}) ⇒ Object Also known as: collabs
81 82 83 |
# File 'lib/octokit/client/repositories.rb', line 81 def collaborators(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/collaborators", )['collaborators'] end |
#contributors(repo, anon = false, options = {}) ⇒ Object Also known as: contribs
106 107 108 109 110 111 112 |
# File 'lib/octokit/client/repositories.rb', line 106 def contributors(repo, anon=false, ={}) if anon get("/api/v2/json/repos/show/#{Repository.new(repo)}/contributors/anon", ) else get("/api/v2/json/repos/show/#{Repository.new(repo)}/contributors", ) end['contributors'] end |
#create_repository(name, options = {}) ⇒ Object Also known as: create_repo, create
38 39 40 |
# File 'lib/octokit/client/repositories.rb', line 38 def create_repository(name, ={}) post("/api/v2/json/repos/create", .merge(:name => name))['repository'] end |
#delete_repository(repo, options = {}) ⇒ Object Also known as: delete_repo
44 45 46 47 48 49 50 51 |
# File 'lib/octokit/client/repositories.rb', line 44 def delete_repository(repo, ={}) response = post("/api/v2/json/repos/delete/#{Repository.new(repo)}", ) if response.respond_to?(:delete_token) response['delete_token'] else response end end |
#delete_repository!(repo, options = {}) ⇒ Object Also known as: delete_repo!
54 55 56 57 |
# File 'lib/octokit/client/repositories.rb', line 54 def delete_repository!(repo, ={}) delete_token = post("/api/v2/json/repos/delete/#{Repository.new(repo)}", ) post("/api/v2/json/repos/delete/#{Repository.new(repo)}", .merge(:delete_token => delete_token)) end |
#deploy_keys(repo, options = {}) ⇒ Object Also known as: list_deploy_keys
68 69 70 |
# File 'lib/octokit/client/repositories.rb', line 68 def deploy_keys(repo, ={}) get("/api/v2/json/repos/keys/#{Repository.new(repo)}", )['public_keys'] end |
#fork(repo, options = {}) ⇒ Object
34 35 36 |
# File 'lib/octokit/client/repositories.rb', line 34 def fork(repo, ={}) post("/api/v2/json/repos/fork/#{Repository.new(repo)}", )['repository'] end |
#languages(repo, options = {}) ⇒ Object
123 124 125 |
# File 'lib/octokit/client/repositories.rb', line 123 def languages(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/languages", )['languages'] end |
#network(repo, options = {}) ⇒ Object
119 120 121 |
# File 'lib/octokit/client/repositories.rb', line 119 def network(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/network", )['network'] end |
#pushable(options = {}) ⇒ Object
96 97 98 |
# File 'lib/octokit/client/repositories.rb', line 96 def pushable(={}) get("/api/v2/json/repos/pushable", )['repositories'] end |
#remove_collaborator(repo, collaborator, options = {}) ⇒ Object Also known as: remove_collab
91 92 93 |
# File 'lib/octokit/client/repositories.rb', line 91 def remove_collaborator(repo, collaborator, ={}) post("/api/v2/json/repos/collaborators/#{Repository.new(repo)}/remove/#{collaborator}")['collaborators'] end |
#remove_deploy_key(repo, id, options = {}) ⇒ Object
77 78 79 |
# File 'lib/octokit/client/repositories.rb', line 77 def remove_deploy_key(repo, id, ={}) post("/api/v2/json/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
19 20 21 |
# File 'lib/octokit/client/repositories.rb', line 19 def repositories(username=login, ={}) get(["/api/v2/json/repos/show", username].compact.join('/'), )['repositories'] end |
#repository(repo, options = {}) ⇒ Object Also known as: repo
9 10 11 |
# File 'lib/octokit/client/repositories.rb', line 9 def repository(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}", )['repository'] end |
#repository_teams(repo, options = {}) ⇒ Object Also known as: repo_teams, teams
100 101 102 |
# File 'lib/octokit/client/repositories.rb', line 100 def repository_teams(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/teams", )['teams'] end |
#search_repositories(q, options = {}) ⇒ Object Also known as: search_repos
4 5 6 |
# File 'lib/octokit/client/repositories.rb', line 4 def search_repositories(q, ={}) get("/api/v2/json/repos/search/#{q}", )['repositories'] end |
#set_private(repo, options = {}) ⇒ Object
60 61 62 |
# File 'lib/octokit/client/repositories.rb', line 60 def set_private(repo, ={}) post("/api/v2/json/repos/set/private/#{Repository.new(repo)}", )['repository'] end |
#set_public(repo, options = {}) ⇒ Object
64 65 66 |
# File 'lib/octokit/client/repositories.rb', line 64 def set_public(repo, ={}) post("/api/v2/json/repos/set/public/#{Repository.new(repo)}", )['repository'] end |
#tags(repo, options = {}) ⇒ Object
127 128 129 |
# File 'lib/octokit/client/repositories.rb', line 127 def (repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/tags", )['tags'] end |
#unwatch(repo, options = {}) ⇒ Object
30 31 32 |
# File 'lib/octokit/client/repositories.rb', line 30 def unwatch(repo, ={}) post("/api/v2/json/repos/unwatch/#{Repository.new(repo)}", )['repository'] end |
#update_repository(repo, values, options = {}) ⇒ Object Also known as: update_repo
14 15 16 |
# File 'lib/octokit/client/repositories.rb', line 14 def update_repository(repo, values, ={}) post("/api/v2/json/repos/show/#{Repository.new(repo)}", .merge({:values => values}))['repository'] end |
#watch(repo, options = {}) ⇒ Object
26 27 28 |
# File 'lib/octokit/client/repositories.rb', line 26 def watch(repo, ={}) post("/api/v2/json/repos/watch/#{Repository.new(repo)}", )['repository'] end |
#watchers(repo, options = {}) ⇒ Object
115 116 117 |
# File 'lib/octokit/client/repositories.rb', line 115 def watchers(repo, ={}) get("/api/v2/json/repos/show/#{Repository.new(repo)}/watchers", )['watchers'] end |