-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoctokit.diff
More file actions
130 lines (125 loc) · 5.06 KB
/
octokit.diff
File metadata and controls
130 lines (125 loc) · 5.06 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
diff --git a/test/data/octokit_before.rb b/test/data/octokit_before.rb
index 3fd0a6c..1e8ff37 100644
--- a/test/data/octokit_before.rb
+++ b/test/data/octokit_before.rb
@@ -17,24 +17,11 @@ module Octokit
#
# @return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.
def commit_comment_reactions(repo, id, options = {})
- get "#{Repository.path repo}/comments/#{id}/reactions", options
- end
+ get "something/something"
- # Create a reaction for a commit comment
- #
- # @param repo [Integer, String, Hash, Repository] A GitHub repository
- # @param id [Integer] The id of the commit comment
- # @param reaction [String] The Reaction
- # @see https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment
- # @see https://developer.github.com/v3/reactions/#reaction-types
- #
- # @example
- # @client.create_commit_comment_reactions("octokit/octokit.rb", 1)
- #
- # @return [<Sawyer::Resource>] Hash representing the reaction
- def create_commit_comment_reaction(repo, id, reaction, options = {})
- options = options.merge(content: reaction)
- post "#{Repository.path repo}/comments/#{id}/reactions", options
+ <<~CODE
+ 1 + 1
+ CODE
end
# List reactions for an issue
@@ -47,8 +34,8 @@ module Octokit
# @client.issue_reactions("octokit/octokit.rb", 1)
#
# @return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.
- def issue_reactions(repo, number, options = {})
- get "#{Repository.path repo}/issues/#{number}/reactions", options
+ def issues_reactions(repo, number, opts = {})
+ get "#{Repository.path repo}/issues/#{number}/reactions", opts
end
# Create reaction for an issue
@@ -61,7 +48,7 @@ module Octokit
# @see https://developer.github.com/v3/reactions/#reaction-types
#
# @example
- # @client.create_issue_reaction("octokit/octokit.rb", 1)
+ # @client.create_issue_reaction("octokit/octokit.rb", 2)
#
# @return [<Sawyer::Resource>] Hash representing the reaction.
def create_issue_reaction(repo, number, reaction, options = {})
@@ -69,6 +56,10 @@ module Octokit
post "#{Repository.path repo}/issues/#{number}/reactions", options
end
+ def hello
+ "world"
+ end
+
# List reactions for an issue comment
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
@@ -135,6 +126,55 @@ module Octokit
post "#{Repository.path repo}/pulls/comments/#{id}/reactions", options
end
+ # Delete a reaction
+ #
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
+ # @param issue_id [Integer] The Issue comment id
+ # @param reaction_id [Integer] The Reaction id
+ #
+ # @see https://docs.github.com/en/rest/reactions/reactions#delete-an-issue-reaction
+ #
+ # @example
+ # @client.delete_issue_reaction("octokit/octokit.rb", 1, 2)
+ #
+ # @return [Boolean] Return true if reaction was deleted, false otherwise.
+ def delete_issue_reaction(repo, issue_id, reaction_id, options = {})
+ boolean_from_response :delete, "#{Repository.path repo}/issues/#{issue_id}/reactions/#{reaction_id}", options
+ end
+
+ # List reactions for a release
+ #
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
+ # @param id [Integer] The Release id
+ #
+ # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release
+ #
+ # @example
+ # @client.release_reactions("octokit/octokit.rb", 1)
+ #
+ # @return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.
+ def release_reactions(repo, release_id, options = {})
+ get "#{Repository.path repo}/releases/#{release_id}/reactions", options
+ end
+
+ # Create reaction for a release
+ #
+ # @param repo [Integer, String, Hash, Repository] A GitHub repository
+ # @param id [Integer] The Release id
+ # @param reaction [String] The Reaction
+ #
+ # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release
+ # @see https://developer.github.com/v3/reactions/#reaction-types
+ #
+ # @example
+ # @client.create_release_reaction("octokit/octokit.rb", 1)
+ #
+ # @return [<Sawyer::Resource>] Hash representing the reaction.
+ def create_release_reaction(repo, release_id, reaction, options = {})
+ options = options.merge(content: reaction)
+ post "#{Repository.path repo}/releases/#{release_id}/reactions", options
+ end
+
# Delete a reaction for a release
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
@@ -153,3 +193,9 @@ module Octokit
end
end
end
+
+module OctoOcto
+ def foofoo
+ Error = Class.new(StandardError)
+ end
+end