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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b00ecbce5093a21be74d3eee9166d35d56643f19
4
- data.tar.gz: 6c38d04507e4c56ff49e0ab34118b103a5f74d5f
3
+ metadata.gz: 6ed7d82fbc25bb37c33f619de497c1d849c7bebe
4
+ data.tar.gz: f29e8deb4431f3620c1830b445c737fea6c119b3
5
5
  SHA512:
6
- metadata.gz: d5fa52659bee078f6707c1e82b4d46c2f157ae256cab35552e623d646ea47182418cac6fc651dc744fdd19527126f33825aabe60400cf16f5e529d56add63e46
7
- data.tar.gz: 6c3d63a1aeaf6ced179149cf94d18b724ca86f035312e2d98a71015bcd95d0dcdacb14cd782c4b9921fef4873d88363006ce5129b6cb6afba82c411684567c0b
6
+ metadata.gz: 4db3f0180f7e096354dd550e4763ec0d9f2a3e32d0f67858f85ed823ae48029a5ac31b2422c99ea9d84a5d2099d6002694ac1f4debafe55e4f629c4cdcda90b1
7
+ data.tar.gz: acdc23db03409efd7d48321cbf987f169defacebe9d9676ffa169fca679498ed288ac616f8f6f77d0e12700c4859d9d79b399e8b0b8916813307115f7c9b4ed6
data/.travis.yml CHANGED
@@ -8,8 +8,4 @@ notifications:
8
8
  email:
9
9
  - rauh.ryan@gmail.com
10
10
 
11
- rvm:
12
- - 1.8.7
13
- - 1.9.3
14
-
15
11
  script: bundle exec rake spec
@@ -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
 
@@ -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
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  class Ghee
3
- VERSION = "0.14.22"
3
+ VERSION = "0.15.22"
4
4
  end
@@ -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.14.22
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-05-24 00:00:00.000000000 Z
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.2.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