groupdocs 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -190,6 +190,26 @@ module GroupDocs
190
190
  end
191
191
  end
192
192
 
193
+ #
194
+ # Returns annotation collaborators.
195
+ #
196
+ # @param [Hash] access Access credentials
197
+ # @option access [String] :client_id
198
+ # @option access [String] :private_key
199
+ # @return [Array<GroupDocs::User>]
200
+ #
201
+ def collaborators!(access = {})
202
+ json = Api::Request.new do |request|
203
+ request[:access] = access
204
+ request[:method] = :GET
205
+ request[:path] = "/ant/{{client_id}}/files/#{document.file.guid}/collaborators"
206
+ end.execute!
207
+
208
+ json[:collaborators].map do |collaborator|
209
+ User.new(collaborator)
210
+ end
211
+ end
212
+
193
213
  #
194
214
  # Sets annotation collaborators to given emails.
195
215
  #
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '0.2.9'
2
+ VERSION = '0.2.10'
3
3
  end # GroupDocs
@@ -206,6 +206,26 @@ describe GroupDocs::Document::Annotation do
206
206
  end
207
207
  end
208
208
 
209
+ describe '#collaborators!' do
210
+ before(:each) do
211
+ mock_api_server(load_json('annotation_collaborators_get'))
212
+ end
213
+
214
+ it 'accepts access credentials hash' do
215
+ lambda do
216
+ subject.collaborators!(client_id: 'client_id', private_key: 'private_key')
217
+ end.should_not raise_error(ArgumentError)
218
+ end
219
+
220
+ it 'returns an array of GroupDocs::User objects' do
221
+ users = subject.collaborators!
222
+ users.should be_an(Array)
223
+ users.each do |user|
224
+ user.should be_a(GroupDocs::User)
225
+ end
226
+ end
227
+ end
228
+
209
229
  describe '#collaborators_set!' do
210
230
  before(:each) do
211
231
  mock_api_server(load_json('annotation_collaborators_set'))
@@ -0,0 +1,16 @@
1
+ {
2
+ "result":
3
+ {
4
+ "collaborators":
5
+ [
6
+ {
7
+ "primary_email": "test1@email.com"
8
+ },
9
+ {
10
+ "primary_email": "test2@email.com"
11
+ }
12
+ ]
13
+ },
14
+ "status": "Ok",
15
+ "error_message": null
16
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &9499160 !ruby/object:Gem::Requirement
16
+ requirement: &12222800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *9499160
24
+ version_requirements: *12222800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &9514140 !ruby/object:Gem::Requirement
27
+ requirement: &12237640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *9514140
35
+ version_requirements: *12237640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-hmac
38
- requirement: &9512320 !ruby/object:Gem::Requirement
38
+ requirement: &12235920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *9512320
46
+ version_requirements: *12235920
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &9510600 !ruby/object:Gem::Requirement
49
+ requirement: &12234200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *9510600
57
+ version_requirements: *12234200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &9509700 !ruby/object:Gem::Requirement
60
+ requirement: &12233160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *9509700
68
+ version_requirements: *12233160
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &9508600 !ruby/object:Gem::Requirement
71
+ requirement: &12232300 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *9508600
79
+ version_requirements: *12232300
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &9521480 !ruby/object:Gem::Requirement
82
+ requirement: &12245240 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *9521480
90
+ version_requirements: *12245240
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &9519360 !ruby/object:Gem::Requirement
93
+ requirement: &12243000 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.8'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *9519360
101
+ version_requirements: *12243000
102
102
  description: Ruby SDK for GroupDocs REST API
103
103
  email: p0deje@gmail.com
104
104
  executables: []
@@ -181,6 +181,7 @@ files:
181
181
  - spec/groupdocs_spec.rb
182
182
  - spec/spec_helper.rb
183
183
  - spec/support/files/resume.pdf
184
+ - spec/support/json/annotation_collaborators_get.json
184
185
  - spec/support/json/annotation_collaborators_set.json
185
186
  - spec/support/json/annotation_create.json
186
187
  - spec/support/json/annotation_list.json
@@ -254,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
255
  version: '0'
255
256
  segments:
256
257
  - 0
257
- hash: 4168816554705662963
258
+ hash: -947784112716663600
258
259
  required_rubygems_version: !ruby/object:Gem::Requirement
259
260
  none: false
260
261
  requirements:
@@ -263,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
264
  version: '0'
264
265
  segments:
265
266
  - 0
266
- hash: 4168816554705662963
267
+ hash: -947784112716663600
267
268
  requirements: []
268
269
  rubyforge_project:
269
270
  rubygems_version: 1.8.10
@@ -305,6 +306,7 @@ test_files:
305
306
  - spec/groupdocs_spec.rb
306
307
  - spec/spec_helper.rb
307
308
  - spec/support/files/resume.pdf
309
+ - spec/support/json/annotation_collaborators_get.json
308
310
  - spec/support/json/annotation_collaborators_set.json
309
311
  - spec/support/json/annotation_create.json
310
312
  - spec/support/json/annotation_list.json