ghee 0.14.22 → 0.15.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -4
- data/lib/ghee/api/issues.rb +36 -0
- data/lib/ghee/state_methods.rb +6 -6
- data/lib/ghee/version.rb +1 -1
- data/spec/ghee/api/issue_assignee_spec.rb +33 -0
- metadata +5 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed7d82fbc25bb37c33f619de497c1d849c7bebe
|
4
|
+
data.tar.gz: f29e8deb4431f3620c1830b445c737fea6c119b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db3f0180f7e096354dd550e4763ec0d9f2a3e32d0f67858f85ed823ae48029a5ac31b2422c99ea9d84a5d2099d6002694ac1f4debafe55e4f629c4cdcda90b1
|
7
|
+
data.tar.gz: acdc23db03409efd7d48321cbf987f169defacebe9d9676ffa169fca679498ed288ac616f8f6f77d0e12700c4859d9d79b399e8b0b8916813307115f7c9b4ed6
|
data/.travis.yml
CHANGED
data/lib/ghee/api/issues.rb
CHANGED
@@ -126,6 +126,42 @@ class Ghee
|
|
126
126
|
Ghee::API::Repos::Issues::Events::Proxy.new(connection,prefix)
|
127
127
|
end
|
128
128
|
|
129
|
+
def assignees(&block)
|
130
|
+
prefix = "#{path_prefix}/assignees"
|
131
|
+
Ghee::API::Repos::Issues::Assignees::Proxy.new(connection, prefix, &block)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
module Assignees
|
136
|
+
class Proxy < ::Ghee::ResourceProxy
|
137
|
+
accept_header "application/vnd.github.cerberus-preview.full+json"
|
138
|
+
|
139
|
+
undef_method :create
|
140
|
+
undef_method :destroy
|
141
|
+
undef_method :patch
|
142
|
+
|
143
|
+
def add(assignees, &block)
|
144
|
+
body = {
|
145
|
+
assignees: assignees
|
146
|
+
}
|
147
|
+
connection.post(path_prefix) do |req|
|
148
|
+
req.headers['Accept'] = "application/vnd.github.cerberus-preview.full+json"
|
149
|
+
req.body = body
|
150
|
+
block.call(req) if block
|
151
|
+
end.body
|
152
|
+
end
|
153
|
+
|
154
|
+
def remove(assignees, &block)
|
155
|
+
body = {
|
156
|
+
assignees: assignees
|
157
|
+
}
|
158
|
+
connection.delete(path_prefix) do |req|
|
159
|
+
req.headers['Accept'] = "application/vnd.github.cerberus-preview.full+json"
|
160
|
+
req.body = body
|
161
|
+
block.call(req) if block
|
162
|
+
end.body
|
163
|
+
end
|
164
|
+
end
|
129
165
|
end
|
130
166
|
end
|
131
167
|
|
data/lib/ghee/state_methods.rb
CHANGED
@@ -5,24 +5,24 @@ class Ghee
|
|
5
5
|
#
|
6
6
|
# return json
|
7
7
|
#
|
8
|
-
def create(attributes)
|
9
|
-
connection.post(path_prefix,attributes).body
|
8
|
+
def create(attributes, &block)
|
9
|
+
connection.post(path_prefix,attributes, &block).body
|
10
10
|
end
|
11
11
|
|
12
12
|
# Patchs
|
13
13
|
#
|
14
14
|
# return json
|
15
15
|
#
|
16
|
-
def patch(attributes)
|
17
|
-
connection.patch(path_prefix, attributes).body
|
16
|
+
def patch(attributes, &block)
|
17
|
+
connection.patch(path_prefix, attributes, &block).body
|
18
18
|
end
|
19
19
|
|
20
20
|
# Destroys
|
21
21
|
#
|
22
22
|
# return boolean
|
23
23
|
#
|
24
|
-
def destroy
|
25
|
-
connection.delete(path_prefix).status == 204
|
24
|
+
def destroy(&block)
|
25
|
+
connection.delete(path_prefix, &block).status == 204
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
data/lib/ghee/version.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Ghee::API::Repos::Issues do
|
4
|
+
subject { Ghee.new(GH_AUTH) }
|
5
|
+
|
6
|
+
context "with issue number" do
|
7
|
+
before(:all) do
|
8
|
+
VCR.use_cassette "issues.test" do
|
9
|
+
@repo = subject.repos(GH_USER, GH_REPO)
|
10
|
+
@test_issue = @repo.issues.create({
|
11
|
+
:title => "Test issue"
|
12
|
+
})
|
13
|
+
end
|
14
|
+
end
|
15
|
+
let(:test_issue) { @test_issue }
|
16
|
+
let(:test_repo) { @repo }
|
17
|
+
|
18
|
+
describe "#assignees" do
|
19
|
+
it "should add and remove an assignee for a given issue" do
|
20
|
+
VCR.use_cassette "#repo#issues(id)#assignees#add&remove" do
|
21
|
+
issue = test_repo.issues(test_issue["number"]).assignees.add([GH_USER])
|
22
|
+
issue['assignees'].size.should > 0
|
23
|
+
issue['assignees'].first['login'].should eq(GH_USER)
|
24
|
+
|
25
|
+
issue = test_repo.issues(test_issue["number"]).assignees.add([GH_USER])
|
26
|
+
issue['assignees'].size.should > 0
|
27
|
+
issue['assignees'].first['login'].should eq(GH_USER)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Rauh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -231,7 +231,6 @@ extra_rdoc_files: []
|
|
231
231
|
files:
|
232
232
|
- ".autotest"
|
233
233
|
- ".gitignore"
|
234
|
-
- ".ruby-version"
|
235
234
|
- ".travis.yml"
|
236
235
|
- Gemfile
|
237
236
|
- LICENSE
|
@@ -280,6 +279,7 @@ files:
|
|
280
279
|
- spec/ghee/api/gists_spec.rb
|
281
280
|
- spec/ghee/api/gitdata_spec.rb
|
282
281
|
- spec/ghee/api/hooks_spec.rb
|
282
|
+
- spec/ghee/api/issue_assignee_spec.rb
|
283
283
|
- spec/ghee/api/issues_spec.rb
|
284
284
|
- spec/ghee/api/milestones_spec.rb
|
285
285
|
- spec/ghee/api/org_members_spec.rb
|
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
315
|
version: '0'
|
316
316
|
requirements: []
|
317
317
|
rubyforge_project: ghee
|
318
|
-
rubygems_version: 2.
|
318
|
+
rubygems_version: 2.6.4
|
319
319
|
signing_key:
|
320
320
|
specification_version: 4
|
321
321
|
summary: Access Github in ruby.
|
@@ -329,6 +329,7 @@ test_files:
|
|
329
329
|
- spec/ghee/api/gists_spec.rb
|
330
330
|
- spec/ghee/api/gitdata_spec.rb
|
331
331
|
- spec/ghee/api/hooks_spec.rb
|
332
|
+
- spec/ghee/api/issue_assignee_spec.rb
|
332
333
|
- spec/ghee/api/issues_spec.rb
|
333
334
|
- spec/ghee/api/milestones_spec.rb
|
334
335
|
- spec/ghee/api/org_members_spec.rb
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.5
|