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_hook(repo, name, config, options = {}) ⇒ Object
- #create_repository(name, options = {}) ⇒ Object (also: #create_repo, #create)
- #deploy_keys(repo, options = {}) ⇒ Object (also: #list_deploy_keys)
- #edit_hook(repo, id, name, config, options = {}) ⇒ Object
- #edit_repository(repo, options = {}) ⇒ Object (also: #edit, #update_repository, #update)
- #fork(repo, options = {}) ⇒ Object
- #forks(repo, options = {}) ⇒ Object (also: #network)
- #hook(repo, id, options = {}) ⇒ Object
- #hooks(repo, options = {}) ⇒ Object
- #languages(repo, options = {}) ⇒ Object
- #pushable(options = {}) ⇒ Object
- #remove_collaborator(repo, collaborator, options = {}) ⇒ Object (also: #remove_collab)
- #remove_deploy_key(repo, id, options = {}) ⇒ Object
- #remove_hook(repo, id, options = {}) ⇒ Object
- #repositories(username = nil, options = {}) ⇒ Object (also: #list_repositories, #list_repos, #repos)
- #repository(repo, options = {}) ⇒ Object (also: #repo)
-
#repository_issue_events(repo, options = {}) ⇒ Array
(also: #repo_issue_events)
Get all Issue Events for a given Repository.
- #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
- #test_hook(repo, id, options = {}) ⇒ Object
- #unwatch(repo, options = {}) ⇒ Object
- #watch(repo, options = {}) ⇒ Object
- #watchers(repo, options = {}) ⇒ Object
Instance Method Details
#add_collaborator(repo, collaborator, options = {}) ⇒ Object Also known as: add_collab
83 84 85 |
# File 'lib/octokit/client/repositories.rb', line 83 def add_collaborator(repo, collaborator, ={}) put "/repos/#{Repository.new repo}/collaborators/#{collaborator}", , 3 end |
#add_deploy_key(repo, title, key, options = {}) ⇒ Object
70 71 72 |
# File 'lib/octokit/client/repositories.rb', line 70 def add_deploy_key(repo, title, key, ={}) post "/repos/#{Repository.new repo}/keys", .merge(:title => title, :key => key), 3 end |
#branches(repo, options = {}) ⇒ Object
126 127 128 |
# File 'lib/octokit/client/repositories.rb', line 126 def branches(repo, ={}) get "/repos/#{Repository.new repo}/branches", , 3 end |
#collaborators(repo, options = {}) ⇒ Object Also known as: collabs
78 79 80 |
# File 'lib/octokit/client/repositories.rb', line 78 def collaborators(repo, ={}) get "/repos/#{Repository.new repo}/collaborators", , 3 end |
#contributors(repo, anon = false, options = {}) ⇒ Object Also known as: contribs
104 105 106 |
# File 'lib/octokit/client/repositories.rb', line 104 def contributors(repo, anon=false, ={}) get "/repos/#{Repository.new repo}/contributors", .merge(:anon => anon), 3 end |
#create_hook(repo, name, config, options = {}) ⇒ Object
138 139 140 141 |
# File 'lib/octokit/client/repositories.rb', line 138 def create_hook(repo, name, config, ={}) = {:name => name, :config => config, :events => ["push"], :active => true}.merge() post "/repos/#{Repository.new repo}/hooks", , 3 end |
#create_repository(name, options = {}) ⇒ Object Also known as: create_repo, create
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/octokit/client/repositories.rb', line 44 def create_repository(name, ={}) organization = .delete :organization .merge! :name => name if organization.nil? post '/user/repos', , 3 else post "/orgs/#{organization}/repos", , 3 end end |
#deploy_keys(repo, options = {}) ⇒ Object Also known as: list_deploy_keys
65 66 67 |
# File 'lib/octokit/client/repositories.rb', line 65 def deploy_keys(repo, ={}) get "/repos/#{Repository.new repo}/keys", , 3 end |
#edit_hook(repo, id, name, config, options = {}) ⇒ Object
143 144 145 146 |
# File 'lib/octokit/client/repositories.rb', line 143 def edit_hook(repo, id, name, config, ={}) = {:name => name, :config => config, :events => ["push"], :active => true}.merge() patch "/repos/#{Repository.new repo}/hooks/#{id}", , 3 end |
#edit_repository(repo, options = {}) ⇒ Object Also known as: edit, update_repository, update
14 15 16 |
# File 'lib/octokit/client/repositories.rb', line 14 def edit_repository(repo, ={}) patch "/repos/#{Repository.new repo}", , 3 end |
#fork(repo, options = {}) ⇒ Object
40 41 42 |
# File 'lib/octokit/client/repositories.rb', line 40 def fork(repo, ={}) post "/repos/#{Repository.new repo}/forks", , 3 end |
#forks(repo, options = {}) ⇒ Object Also known as: network
113 114 115 |
# File 'lib/octokit/client/repositories.rb', line 113 def forks(repo, ={}) get "/repos/#{Repository.new repo}/forks", , 3 end |
#hook(repo, id, options = {}) ⇒ Object
134 135 136 |
# File 'lib/octokit/client/repositories.rb', line 134 def hook(repo, id, ={}) get "/repos/#{Repository.new repo}/hooks/#{id}", , 3 end |
#hooks(repo, options = {}) ⇒ Object
130 131 132 |
# File 'lib/octokit/client/repositories.rb', line 130 def hooks(repo, ={}) get "/repos/#{Repository.new repo}/hooks", , 3 end |
#languages(repo, options = {}) ⇒ Object
118 119 120 |
# File 'lib/octokit/client/repositories.rb', line 118 def languages(repo, ={}) get "/repos/#{Repository.new repo}/languages", , 3 end |
#pushable(options = {}) ⇒ Object
93 94 95 96 |
# File 'lib/octokit/client/repositories.rb', line 93 def pushable(={}) # There isn't a matching method in V3 of the api get("/api/v2/json/repos/pushable", , 2)['repositories'] end |
#remove_collaborator(repo, collaborator, options = {}) ⇒ Object Also known as: remove_collab
88 89 90 |
# File 'lib/octokit/client/repositories.rb', line 88 def remove_collaborator(repo, collaborator, ={}) delete "/repos/#{Repository.new repo}/collaborators/#{collaborator}", , 3 end |
#remove_deploy_key(repo, id, options = {}) ⇒ Object
74 75 76 |
# File 'lib/octokit/client/repositories.rb', line 74 def remove_deploy_key(repo, id, ={}) delete "/repos/#{Repository.new repo}/keys/#{id}", , 3 end |
#remove_hook(repo, id, options = {}) ⇒ Object
148 149 150 |
# File 'lib/octokit/client/repositories.rb', line 148 def remove_hook(repo, id, ={}) delete "/repos/#{Repository.new repo}/hooks/#{id}", , 3 end |
#repositories(username = nil, options = {}) ⇒ Object Also known as: list_repositories, list_repos, repos
21 22 23 24 25 26 27 |
# File 'lib/octokit/client/repositories.rb', line 21 def repositories(username=nil, ={}) if username.nil? get '/user/repos', , 3 else get "/users/#{username}/repos", , 3 end end |
#repository(repo, options = {}) ⇒ Object Also known as: repo
9 10 11 |
# File 'lib/octokit/client/repositories.rb', line 9 def repository(repo, ={}) get "/repos/#{Repository.new repo}", , 3 end |
#repository_issue_events(repo, options = {}) ⇒ Array Also known as: repo_issue_events
Get all Issue Events for a given Repository
164 165 166 |
# File 'lib/octokit/client/repositories.rb', line 164 def repository_issue_events(repo, ={}) get "/repos/#{Repository.new repo}/issues/events", , 3 end |
#repository_teams(repo, options = {}) ⇒ Object Also known as: repo_teams, teams
98 99 100 |
# File 'lib/octokit/client/repositories.rb', line 98 def repository_teams(repo, ={}) get "/repos/#{Repository.new repo}/teams", , 3 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("/legacy/repos/search/#{q}", , 3)['repositories'] end |
#set_private(repo, options = {}) ⇒ Object
57 58 59 |
# File 'lib/octokit/client/repositories.rb', line 57 def set_private(repo, ={}) update_repository repo, .merge({ :private => true }) end |
#set_public(repo, options = {}) ⇒ Object
61 62 63 |
# File 'lib/octokit/client/repositories.rb', line 61 def set_public(repo, ={}) update_repository repo, .merge({ :private => false }) end |
#tags(repo, options = {}) ⇒ Object
122 123 124 |
# File 'lib/octokit/client/repositories.rb', line 122 def (repo, ={}) get "/repos/#{Repository.new repo}/tags", , 3 end |
#test_hook(repo, id, options = {}) ⇒ Object
152 153 154 |
# File 'lib/octokit/client/repositories.rb', line 152 def test_hook(repo, id, ={}) post "/repos/#{Repository.new repo}/hooks/#{id}/test", , 3 end |
#unwatch(repo, options = {}) ⇒ Object
36 37 38 |
# File 'lib/octokit/client/repositories.rb', line 36 def unwatch(repo, ={}) delete "/user/watched/#{Repository.new repo}", , 3 end |
#watch(repo, options = {}) ⇒ Object
32 33 34 |
# File 'lib/octokit/client/repositories.rb', line 32 def watch(repo, ={}) put "/user/watched/#{Repository.new repo}", , 3 end |
#watchers(repo, options = {}) ⇒ Object
109 110 111 |
# File 'lib/octokit/client/repositories.rb', line 109 def watchers(repo, ={}) get "/repos/#{Repository.new repo}/watchers", , 3 end |