groupdocs 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -36,19 +36,24 @@ module GroupDocs
|
|
36
36
|
attr_accessor :box
|
37
37
|
# @attr [Array<GroupDocs::Document::Annotation::Reply>] replies
|
38
38
|
attr_accessor :replies
|
39
|
+
# @attr [Hash] annotationPosition
|
40
|
+
attr_accessor :annotationPosition
|
39
41
|
|
40
42
|
# Compatibility with response JSON
|
41
43
|
alias_method :annotationGuid=, :guid=
|
42
44
|
|
43
45
|
# Human-readable accessors
|
44
|
-
alias_method :session_guid,
|
45
|
-
alias_method :session_guid=,
|
46
|
-
alias_method :document_guid,
|
47
|
-
alias_method :document_guid=,
|
48
|
-
alias_method :reply_guid,
|
49
|
-
alias_method :reply_guid=,
|
50
|
-
alias_method :created_on,
|
51
|
-
alias_method :created_on=,
|
46
|
+
alias_method :session_guid, :sessionGuid
|
47
|
+
alias_method :session_guid=, :sessionGuid=
|
48
|
+
alias_method :document_guid, :documentGuid
|
49
|
+
alias_method :document_guid=, :documentGuid=
|
50
|
+
alias_method :reply_guid, :replyGuid
|
51
|
+
alias_method :reply_guid=, :replyGuid=
|
52
|
+
alias_method :created_on, :createdOn
|
53
|
+
alias_method :created_on=, :createdOn=
|
54
|
+
alias_method :annotation_position, :annotationPosition
|
55
|
+
alias_method :annotation_position=, :annotationPosition=
|
56
|
+
alias_method :position, :annotation_position
|
52
57
|
|
53
58
|
#
|
54
59
|
# Creates new GroupDocs::Document::Annotation.
|
@@ -240,5 +245,25 @@ module GroupDocs
|
|
240
245
|
Document::Annotation::Reply.get!(self, options, access)
|
241
246
|
end
|
242
247
|
|
248
|
+
#
|
249
|
+
# Moves annotation to given coordinates.
|
250
|
+
#
|
251
|
+
# @param [Integer, Float] x
|
252
|
+
# @param [Integer, Float] y
|
253
|
+
# @param [Hash] access Access credentials
|
254
|
+
# @option access [String] :client_id
|
255
|
+
# @option access [String] :private_key
|
256
|
+
#
|
257
|
+
def move!(x, y, access = {})
|
258
|
+
Api::Request.new do |request|
|
259
|
+
request[:access] = access
|
260
|
+
request[:method] = :PUT
|
261
|
+
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/position"
|
262
|
+
request[:request_body] = { x: x, y: y }
|
263
|
+
end.execute!
|
264
|
+
|
265
|
+
self.annotation_position = { x: x, y: y }
|
266
|
+
end
|
267
|
+
|
243
268
|
end # Document::Annotation
|
244
269
|
end # GroupDocs
|
data/lib/groupdocs/version.rb
CHANGED
@@ -10,28 +10,30 @@ describe GroupDocs::Document::Annotation do
|
|
10
10
|
described_class.new(document: document)
|
11
11
|
end
|
12
12
|
|
13
|
-
it { should respond_to(:document)
|
14
|
-
it { should respond_to(:document=)
|
15
|
-
it { should respond_to(:id)
|
16
|
-
it { should respond_to(:id=)
|
17
|
-
it { should respond_to(:guid)
|
18
|
-
it { should respond_to(:guid=)
|
19
|
-
it { should respond_to(:sessionGuid)
|
20
|
-
it { should respond_to(:sessionGuid=)
|
21
|
-
it { should respond_to(:documentGuid)
|
22
|
-
it { should respond_to(:documentGuid=)
|
23
|
-
it { should respond_to(:replyGuid)
|
24
|
-
it { should respond_to(:replyGuid=)
|
25
|
-
it { should respond_to(:createdOn)
|
26
|
-
it { should respond_to(:createdOn=)
|
27
|
-
it { should respond_to(:type)
|
28
|
-
it { should respond_to(:type=)
|
29
|
-
it { should respond_to(:access)
|
30
|
-
it { should respond_to(:access=)
|
31
|
-
it { should respond_to(:box)
|
32
|
-
it { should respond_to(:box=)
|
33
|
-
it { should respond_to(:replies)
|
34
|
-
it { should respond_to(:replies=)
|
13
|
+
it { should respond_to(:document) }
|
14
|
+
it { should respond_to(:document=) }
|
15
|
+
it { should respond_to(:id) }
|
16
|
+
it { should respond_to(:id=) }
|
17
|
+
it { should respond_to(:guid) }
|
18
|
+
it { should respond_to(:guid=) }
|
19
|
+
it { should respond_to(:sessionGuid) }
|
20
|
+
it { should respond_to(:sessionGuid=) }
|
21
|
+
it { should respond_to(:documentGuid) }
|
22
|
+
it { should respond_to(:documentGuid=) }
|
23
|
+
it { should respond_to(:replyGuid) }
|
24
|
+
it { should respond_to(:replyGuid=) }
|
25
|
+
it { should respond_to(:createdOn) }
|
26
|
+
it { should respond_to(:createdOn=) }
|
27
|
+
it { should respond_to(:type) }
|
28
|
+
it { should respond_to(:type=) }
|
29
|
+
it { should respond_to(:access) }
|
30
|
+
it { should respond_to(:access=) }
|
31
|
+
it { should respond_to(:box) }
|
32
|
+
it { should respond_to(:box=) }
|
33
|
+
it { should respond_to(:replies) }
|
34
|
+
it { should respond_to(:replies=) }
|
35
|
+
it { should respond_to(:annotationPosition) }
|
36
|
+
it { should respond_to(:annotationPosition=) }
|
35
37
|
|
36
38
|
it 'has human-readable accessors' do
|
37
39
|
subject.should respond_to(:session_guid)
|
@@ -42,14 +44,20 @@ describe GroupDocs::Document::Annotation do
|
|
42
44
|
subject.should respond_to(:reply_guid=)
|
43
45
|
subject.should respond_to(:created_on)
|
44
46
|
subject.should respond_to(:created_on=)
|
45
|
-
subject.
|
46
|
-
subject.
|
47
|
-
subject.
|
48
|
-
subject.method(:
|
49
|
-
subject.method(:
|
50
|
-
subject.method(:
|
47
|
+
subject.should respond_to(:annotation_position)
|
48
|
+
subject.should respond_to(:annotation_position=)
|
49
|
+
subject.should respond_to(:position)
|
50
|
+
subject.method(:session_guid).should == subject.method(:sessionGuid)
|
51
|
+
subject.method(:session_guid=).should == subject.method(:sessionGuid=)
|
52
|
+
subject.method(:document_guid).should == subject.method(:documentGuid)
|
53
|
+
subject.method(:document_guid=).should == subject.method(:documentGuid=)
|
54
|
+
subject.method(:reply_guid).should == subject.method(:replyGuid)
|
55
|
+
subject.method(:reply_guid=).should == subject.method(:replyGuid=)
|
51
56
|
# Annotation#created_on is overwritten
|
52
|
-
subject.method(:created_on=).should
|
57
|
+
subject.method(:created_on=).should == subject.method(:createdOn=)
|
58
|
+
subject.method(:annotation_position).should == subject.method(:annotationPosition)
|
59
|
+
subject.method(:annotation_position=).should == subject.method(:annotationPosition=)
|
60
|
+
subject.method(:position).should == subject.method(:annotation_position)
|
53
61
|
end
|
54
62
|
|
55
63
|
it 'is compatible with response JSON' do
|
@@ -241,4 +249,22 @@ describe GroupDocs::Document::Annotation do
|
|
241
249
|
subject.replies!
|
242
250
|
end
|
243
251
|
end
|
252
|
+
|
253
|
+
describe '#move!' do
|
254
|
+
before(:each) do
|
255
|
+
mock_api_server(load_json('annotation_move'))
|
256
|
+
end
|
257
|
+
|
258
|
+
it 'accepts access credentials hash' do
|
259
|
+
lambda do
|
260
|
+
subject.move!(10, 10, client_id: 'client_id', private_key: 'private_key')
|
261
|
+
end.should_not raise_error(ArgumentError)
|
262
|
+
end
|
263
|
+
|
264
|
+
it 'updates annotation position' do
|
265
|
+
lambda do
|
266
|
+
subject.move!(10, 10)
|
267
|
+
end.should change(subject, :annotation_position).to(x: 10, y: 10)
|
268
|
+
end
|
269
|
+
end
|
244
270
|
end
|
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.
|
4
|
+
version: 0.2.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
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: &
|
16
|
+
requirement: &9499160 !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: *
|
24
|
+
version_requirements: *9499160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &9514140 !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: *
|
35
|
+
version_requirements: *9514140
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ruby-hmac
|
38
|
-
requirement: &
|
38
|
+
requirement: &9512320 !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: *
|
46
|
+
version_requirements: *9512320
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &9510600 !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: *
|
57
|
+
version_requirements: *9510600
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &9509700 !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: *
|
68
|
+
version_requirements: *9509700
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &9508600 !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: *
|
79
|
+
version_requirements: *9508600
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: yard
|
82
|
-
requirement: &
|
82
|
+
requirement: &9521480 !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: *
|
90
|
+
version_requirements: *9521480
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: webmock
|
93
|
-
requirement: &
|
93
|
+
requirement: &9519360 !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: *
|
101
|
+
version_requirements: *9519360
|
102
102
|
description: Ruby SDK for GroupDocs REST API
|
103
103
|
email: p0deje@gmail.com
|
104
104
|
executables: []
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- spec/support/json/annotation_collaborators_set.json
|
185
185
|
- spec/support/json/annotation_create.json
|
186
186
|
- spec/support/json/annotation_list.json
|
187
|
+
- spec/support/json/annotation_move.json
|
187
188
|
- spec/support/json/annotation_remove.json
|
188
189
|
- spec/support/json/annotation_replies_create.json
|
189
190
|
- spec/support/json/annotation_replies_get.json
|
@@ -253,7 +254,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
253
254
|
version: '0'
|
254
255
|
segments:
|
255
256
|
- 0
|
256
|
-
hash:
|
257
|
+
hash: 4168816554705662963
|
257
258
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
259
|
none: false
|
259
260
|
requirements:
|
@@ -262,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
263
|
version: '0'
|
263
264
|
segments:
|
264
265
|
- 0
|
265
|
-
hash:
|
266
|
+
hash: 4168816554705662963
|
266
267
|
requirements: []
|
267
268
|
rubyforge_project:
|
268
269
|
rubygems_version: 1.8.10
|
@@ -307,6 +308,7 @@ test_files:
|
|
307
308
|
- spec/support/json/annotation_collaborators_set.json
|
308
309
|
- spec/support/json/annotation_create.json
|
309
310
|
- spec/support/json/annotation_list.json
|
311
|
+
- spec/support/json/annotation_move.json
|
310
312
|
- spec/support/json/annotation_remove.json
|
311
313
|
- spec/support/json/annotation_replies_create.json
|
312
314
|
- spec/support/json/annotation_replies_get.json
|