Skip to content

Commit 6d272a6

Browse files
committed
Move repo forks, update responses, fix a few issues
1 parent 52f5a0e commit 6d272a6

5 files changed

Lines changed: 55 additions & 47 deletions

File tree

Rakefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
require 'nanoc3/tasks'
1+
require 'nanoc3/tasks'
2+
3+
task :publish => [:clean] do
4+
sh "nanoc compile"
5+
sh "cp -r output/ ../developer.github.pages"
6+
end

content/v3/repos.md

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,6 @@ in results.
101101
<%= headers 200 %>
102102
<%= json(:user) { |h| [h] } %>
103103

104-
## List collaborators
105-
106-
GET /repos/:user/:repo/collaborators
107-
108-
### Response
109-
110-
<%= headers 200 %>
111-
<%= json(:user) { |h| [h] } %>
112-
113104
## List languages
114105

115106
GET /repos/:user/:repo/languages
@@ -138,10 +129,7 @@ in results.
138129
### Response
139130

140131
<%= headers 200 %>
141-
<%= json \
142-
"v0.1" => "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
143-
"v0.2" => "6dcb09b5b57875f334f61aebed695e2e4193db5e",
144-
%>
132+
<%= json(:tag) { |h| [h] } %>
145133

146134
## List Branches
147135

@@ -150,35 +138,4 @@ in results.
150138
### Response
151139

152140
<%= headers 200 %>
153-
<%= json \
154-
"gh-pages" => "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
155-
"master" => "6dcb09b5b57875f334f61aebed695e2e4193db5e",
156-
"development" => "1071c56519866afd41db2f30705eba8406b6a4a1",
157-
%>
158-
159-
## List forks
160-
161-
GET /repos/:user/:repo/forks
162-
163-
### Response
164-
165-
<%= headers 200 %>
166-
<%= json(:repo) { |h| [h] } %>
167-
168-
## Create a fork
169-
170-
Create a fork for the authenicated user.
171-
172-
POST /repos/:user/:repo/forks
173-
174-
### Parameters
175-
176-
org
177-
: Optional _String_ Organization login. The repository will be forked
178-
into this organization.
179-
180-
### Response
181-
182-
<%= headers 201 %>
183-
<%= json :repo %>
184-
141+
<%= json(:branch) { |h| [h] }%>

content/v3/repos/forks.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Repo Forks API v3 | developer.github.com
3+
---
4+
5+
# Repo Forks API
6+
7+
## List forks
8+
9+
GET /repos/:user/:repo/forks
10+
11+
### Response
12+
13+
<%= headers 200 %>
14+
<%= json(:repo) { |h| [h] } %>
15+
16+
## Create a fork
17+
18+
Create a fork for the authenicated user.
19+
20+
POST /repos/:user/:repo/forks
21+
22+
### Parameters
23+
24+
org
25+
: Optional _String_ Organization login. The repository will be forked
26+
into this organization.
27+
28+
### Response
29+
30+
<%= headers 201 %>
31+
<%= json :repo %>

layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ <h3><a href="/v3/orgs/">Orgs</a></h3>
6969
<h3><a href="/v3/repos/">Repos</a></h3>
7070
<ul>
7171
<li><a href="/v3/repos/collaborators/">Collaborators</a></li>
72+
<li><a href="/v3/repos/forks/">Forks</a></li>
7273
<li><a href="/v3/repos/keys/">Keys</a></li>
7374
<li><a href="/v3/repos/watching/">Watching</a></li>
7475
</ul>

lib/resources.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,24 @@ def json(key)
129129
"has_downloads" => true
130130
})
131131

132+
TAG = {
133+
:commit_url => "https://api.github.com/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
134+
:name => "v0.1",
135+
:sha => "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
136+
:zipball_url => 'https://github.com/octocat/Hello-World/zipball/v0.1',
137+
:tarball_url => 'https://github.com/octocat/Hello-World/tarball/v0.1',
138+
}
139+
140+
BRANCH = {
141+
:commit_url => "https://api.github.com/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
142+
:name => 'master',
143+
:sha => '6dcb09b5b57875f334f61aebed695e2e4193db5e'
144+
}
145+
132146
ORG = {
133147
"login" => "github",
134148
"id" => 1,
135-
"url" => "https://apit.github.com/orgs/1",
149+
"url" => "https://api.github.com/orgs/1",
136150
"avatar_url" => "https://github.com/images/error/octocat_happy.gif"
137151
}
138152

0 commit comments

Comments
 (0)