This repository was archived by the owner on Nov 1, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathreleases.rb
More file actions
71 lines (66 loc) · 2.98 KB
/
releases.rb
File metadata and controls
71 lines (66 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require_relative 'user'
module GitHub
module Resources
module Responses
RELEASE_ASSET ||= {
"url" => "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
"browser_download_url" => "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
"id" => 1,
"name" => "example.zip",
"label" => "short description",
"state" => "uploaded",
"content_type" => "application/zip",
"size" => 1024,
"download_count" => 42,
"created_at" => "2013-02-27T19:35:32Z",
"updated_at" => "2013-02-27T19:35:32Z",
"uploader" => USER
}
RELEASE ||= {
"url" => "https://api.github.com/repos/octocat/Hello-World/releases/1",
"html_url" => "https://github.com/octocat/Hello-World/releases/v1.0.0",
"assets_url" => "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
"upload_url" => "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
"tarball_url" => "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0",
"zipball_url" => "https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0",
"id" => 1,
"tag_name" => "v1.0.0",
"target_commitish" => "master",
"name" => "v1.0.0",
"body" => "Description of the release",
"draft" => false,
"prerelease" => false,
"created_at" => "2013-02-27T19:35:32Z",
"published_at" => "2013-02-27T19:35:32Z",
"author" => USER,
"assets" => [RELEASE_ASSET]
}
CREATED_RELEASE ||= RELEASE.merge({
"assets" => []
})
DOWNLOAD ||= {
"url" => "https://api.github.com/repos/octocat/Hello-World/downloads/1",
"html_url" => "https://github.com/repos/octocat/Hello-World/downloads/new_file.jpg",
"id" => 1,
"name" => "new_file.jpg",
"description" => "Description of your download",
"size" => 1024,
"download_count" => 40,
"content_type" => ".jpg"
}
CREATE_DOWNLOAD ||= DOWNLOAD.merge({
"policy" => "ewogICAg...",
"signature" => "mwnFDC...",
"bucket" => "github",
"accesskeyid" => "1ABCDEFG...",
"path" => "downloads/octocat/Hello-World/new_file.jpg",
"acl" => "public-read",
"expirationdate" => "2011-04-14T16:00:49Z",
"prefix" => "downloads/octocat/Hello-World/",
"mime_type" => "image/jpeg",
"redirect" => false,
"s3_url" => "https://github.s3.amazonaws.com/"
})
end
end
end