Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 0c241cd

Browse files
committed
update releases and assets descriptions
1 parent 93d303e commit 0c241cd

2 files changed

Lines changed: 23 additions & 14 deletions

File tree

content/v3/repos/releases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ will receive published releases only.
1515

1616
GET /repos/:owner/:repo/releases
1717

18-
Note: This returns a list of releases, which does not include regular
18+
Note: This returns a list of releases, which does not include regular
1919
Git tags that have not been associated with a release.
2020
To get a list of Git tags, use the [Repository Tags API][repo tags api].
2121

@@ -68,7 +68,7 @@ Name | Type | Description
6868

6969
<%= headers 201,
7070
:Location => 'https://api.github.com/repos/octocat/Hello-World/releases/1' %>
71-
<%= json(:release) %>
71+
<%= json(:created_release) %>
7272

7373
## Edit a release
7474

lib/resources.rb

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,27 @@ def text_html(response, status, head = {})
556556
}
557557
}
558558

559+
RELEASE_ASSET = {
560+
"url" => "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
561+
"id" => 1,
562+
"name" => "example.zip",
563+
"label" => "short description",
564+
"state" => "uploaded",
565+
"content_type" => "application/zip",
566+
"size" => 1024,
567+
"download_count" => 42,
568+
"created_at" => "2013-02-27T19:35:32Z",
569+
"updated_at" => "2013-02-27T19:35:32Z",
570+
"uploader" => USER
571+
}
572+
559573
RELEASE = {
560574
"url" => "https://api.github.com/repos/octocat/Hello-World/releases/1",
561575
"html_url" => "https://github.com/octocat/Hello-World/releases/v1.0.0",
562576
"assets_url" => "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
563577
"upload_url" => "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name}",
578+
"tarball_url" => "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0",
579+
"zipball_url" => "https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0",
564580
"id" => 1,
565581
"tag_name" => "v1.0.0",
566582
"target_commitish" => "master",
@@ -570,20 +586,13 @@ def text_html(response, status, head = {})
570586
"prerelease" => false,
571587
"created_at" => "2013-02-27T19:35:32Z",
572588
"published_at" => "2013-02-27T19:35:32Z",
589+
"author" => USER,
590+
"assets" => [RELEASE_ASSET]
573591
}
574592

575-
RELEASE_ASSET = {
576-
"url" => "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
577-
"id" => 1,
578-
"name" => "example.zip",
579-
"label" => "short description",
580-
"state" => "uploaded",
581-
"content_type" => "application/zip",
582-
"size" => 1024,
583-
"download_count" => 42,
584-
"created_at" => "2013-02-27T19:35:32Z",
585-
"updated_at" => "2013-02-27T19:35:32Z"
586-
}
593+
CREATED_RELEASE = RELEASE.merge({
594+
"assets" => []
595+
})
587596

588597
DOWNLOAD = {
589598
"url" => "https://api.github.com/repos/octocat/Hello-World/downloads/1",

0 commit comments

Comments
 (0)