groupdocs 1.9.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG.md +13 -0
  2. data/README.md +1 -1
  3. data/examples/api-samples/Gemfile +1 -1
  4. data/examples/api-samples/Gemfile.lock +29 -23
  5. data/examples/api-samples/public/css/style.css +10 -2
  6. data/examples/api-samples/public/docs/sample11.html +11 -7
  7. data/examples/api-samples/samples/sample11.rb +4 -6
  8. data/examples/api-samples/views/_others_samples.haml +231 -91
  9. data/examples/api-samples/views/index.haml +230 -92
  10. data/examples/api-samples/views/sample07.haml +1 -1
  11. data/examples/api-samples/web.rb +1 -0
  12. data/groupdocs.gemspec +2 -2
  13. data/lib/groupdocs/api.rb +1 -0
  14. data/lib/groupdocs/document.rb +12 -0
  15. data/lib/groupdocs/document/annotation.rb +5 -0
  16. data/lib/groupdocs/document/annotation/marker.rb +1 -1
  17. data/lib/groupdocs/document/editor.rb +13 -1
  18. data/lib/groupdocs/document/metadata.rb +6 -0
  19. data/lib/groupdocs/document/option.rb +9 -0
  20. data/lib/groupdocs/signature/form.rb +4 -6
  21. data/lib/groupdocs/storage/file.rb +1 -2
  22. data/lib/groupdocs/version.rb +1 -1
  23. data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +3 -3
  24. data/spec/groupdocs/api/helpers/byte_flag_helper_spec.rb +2 -2
  25. data/spec/groupdocs/datasource_spec.rb +5 -46
  26. data/spec/groupdocs/document/annotation/reply_spec.rb +5 -5
  27. data/spec/groupdocs/document/annotation/reviewer_spec.rb +2 -2
  28. data/spec/groupdocs/document/annotation_spec.rb +11 -43
  29. data/spec/groupdocs/document_spec.rb +61 -298
  30. data/spec/groupdocs/job_spec.rb +20 -74
  31. data/spec/groupdocs/questionnaire/collector_spec.rb +8 -8
  32. data/spec/groupdocs/questionnaire/execution_spec.rb +6 -6
  33. data/spec/groupdocs/questionnaire_spec.rb +28 -58
  34. data/spec/groupdocs/signature/contact_spec.rb +7 -7
  35. data/spec/groupdocs/signature/envelope_spec.rb +30 -34
  36. data/spec/groupdocs/signature/field_spec.rb +5 -5
  37. data/spec/groupdocs/signature/form_spec.rb +28 -16
  38. data/spec/groupdocs/signature/list_spec.rb +3 -3
  39. data/spec/groupdocs/signature/role_spec.rb +2 -2
  40. data/spec/groupdocs/signature/template_spec.rb +4 -4
  41. data/spec/groupdocs/signature_spec.rb +7 -20
  42. data/spec/groupdocs/storage/file_spec.rb +24 -80
  43. data/spec/groupdocs/storage/folder_spec.rb +14 -14
  44. data/spec/groupdocs/storage/package_spec.rb +2 -2
  45. data/spec/groupdocs/storage_spec.rb +1 -1
  46. data/spec/groupdocs/subscription_spec.rb +4 -123
  47. data/spec/groupdocs/user_spec.rb +14 -243
  48. data/spec/spec_helper.rb +4 -0
  49. data/spec/support/json/annotation_marker_move.json +11 -0
  50. data/spec/support/json/envelope_recipient_add.json +27 -0
  51. data/spec/support/json/job_documents.json +35 -103
  52. data/spec/support/shared_examples/signature/shared/document_methods.rb +4 -4
  53. data/spec/support/shared_examples/signature/shared/entity_methods.rb +10 -10
  54. data/spec/support/shared_examples/signature/shared/field_methods.rb +14 -18
  55. data/spec/support/shared_examples/signature/shared/recipient_methods.rb +3 -3
  56. data/spec/support/shared_examples/signature/shared/resource_methods.rb +2 -2
  57. metadata +13 -7
@@ -8,7 +8,7 @@ shared_examples_for GroupDocs::Signature::DocumentMethods do
8
8
  it 'accepts access credentials hash' do
9
9
  lambda do
10
10
  subject.documents!(:client_id => 'client_id', :private_key => 'private_key')
11
- end.should_not raise_error(ArgumentError)
11
+ end.should_not raise_error()
12
12
  end
13
13
 
14
14
  it 'returns array of GroupDocs::Document objects' do
@@ -32,13 +32,13 @@ shared_examples_for GroupDocs::Signature::DocumentMethods do
32
32
  it 'accepts access credentials hash' do
33
33
  lambda do
34
34
  subject.add_document!(document, {}, :client_id => 'client_id', :private_key => 'private_key')
35
- end.should_not raise_error(ArgumentError)
35
+ end.should_not raise_error()
36
36
  end
37
37
 
38
38
  it 'accepts options hash' do
39
39
  lambda do
40
40
  subject.add_document!(document, :order => 1)
41
- end.should_not raise_error(ArgumentError)
41
+ end.should_not raise_error()
42
42
  end
43
43
 
44
44
  it 'raises error if document is not GroupDocs::Document object' do
@@ -58,7 +58,7 @@ shared_examples_for GroupDocs::Signature::DocumentMethods do
58
58
  it 'accepts access credentials hash' do
59
59
  lambda do
60
60
  subject.remove_document!(document, :client_id => 'client_id', :private_key => 'private_key')
61
- end.should_not raise_error(ArgumentError)
61
+ end.should_not raise_error()
62
62
  end
63
63
 
64
64
  it 'raises error if document is not GroupDocs::Document object' do
@@ -8,7 +8,7 @@ shared_examples_for GroupDocs::Signature::EntityMethods do
8
8
  it 'accepts access credentials hash' do
9
9
  lambda do
10
10
  described_class.get!("j5498fre9fje9f", :client_id => 'client_id', :private_key => 'private_key')
11
- end.should_not raise_error(ArgumentError)
11
+ end.should_not raise_error()
12
12
  end
13
13
 
14
14
  it "returns #{described_class} objects" do
@@ -26,13 +26,13 @@ shared_examples_for GroupDocs::Signature::EntityMethods do
26
26
  it 'accepts access credentials hash' do
27
27
  lambda do
28
28
  subject.create!({}, :client_id => 'client_id', :private_key => 'private_key')
29
- end.should_not raise_error(ArgumentError)
29
+ end.should_not raise_error()
30
30
  end
31
31
 
32
32
  it 'accepts options hash' do
33
33
  lambda do
34
34
  subject.create!(:template_id => 'aodfh43yr9834hf943h')
35
- end.should_not raise_error(ArgumentError)
35
+ end.should_not raise_error()
36
36
  end
37
37
 
38
38
  it 'uses hashed version of self as request body' do
@@ -56,7 +56,7 @@ shared_examples_for GroupDocs::Signature::EntityMethods do
56
56
  it 'accepts access credentials hash' do
57
57
  lambda do
58
58
  subject.modify!(:client_id => 'client_id', :private_key => 'private_key')
59
- end.should_not raise_error(ArgumentError)
59
+ end.should_not raise_error()
60
60
  end
61
61
 
62
62
  it 'uses hashed version of self as request body' do
@@ -73,22 +73,22 @@ shared_examples_for GroupDocs::Signature::EntityMethods do
73
73
  it 'accepts access credentials hash' do
74
74
  lambda do
75
75
  subject.rename!('Name', :client_id => 'client_id', :private_key => 'private_key')
76
- end.should_not raise_error(ArgumentError)
76
+ end.should_not raise_error()
77
77
  end
78
78
 
79
79
  # alter params for form
80
80
  if described_class == GroupDocs::Signature::Form
81
81
  it 'uses new_name as parameter' do
82
- api = stub(GroupDocs::Api::Request)
83
- api.stub!(:execute! => {})
82
+ api = double(GroupDocs::Api::Request)
83
+ api.stub(:execute! => {})
84
84
  GroupDocs::Api::Request.stub(:new => api)
85
85
  api.should_receive(:add_params).with(:new_name => 'Name')
86
86
  subject.rename!('Name')
87
87
  end
88
88
  else
89
89
  it 'uses name as parameter' do
90
- api = stub(GroupDocs::Api::Request)
91
- api.stub!(:execute! => {})
90
+ api = double(GroupDocs::Api::Request)
91
+ api.stub(:execute! => {})
92
92
  GroupDocs::Api::Request.stub(:new => api)
93
93
  api.should_receive(:add_params).with(:name => 'Name')
94
94
  subject.rename!('Name')
@@ -110,7 +110,7 @@ shared_examples_for GroupDocs::Signature::EntityMethods do
110
110
  it 'accepts access credentials hash' do
111
111
  lambda do
112
112
  subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
113
- end.should_not raise_error(ArgumentError)
113
+ end.should_not raise_error()
114
114
  end
115
115
  end
116
116
  end
@@ -18,16 +18,8 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
18
18
 
19
19
  it 'accepts access credentials hash' do
20
20
  lambda do
21
- subject.fields!(*args, :client_id => 'client_id', :private_key => 'private_key')
22
- end.should_not raise_error(ArgumentError)
23
- end
24
-
25
- it 'returns array of GroupDocs::Signature::Field objects' do
26
- fields = subject.fields!(*args)
27
- fields.should be_an(Array)
28
- fields.each do |field|
29
- field.should be_a(GroupDocs::Signature::Field)
30
- end
21
+ subject.fields!(document, recipient, {}, :client_id => 'client_id', :private_key => 'private_key')
22
+ end.should_not raise_error()
31
23
  end
32
24
  end
33
25
 
@@ -43,7 +35,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
43
35
  it 'accepts access credentials hash' do
44
36
  lambda do
45
37
  subject.add_field!(field, *args, { :force_new_field => false }, :client_id => 'client_id', :private_key => 'private_key')
46
- end.should_not raise_error(ArgumentError)
38
+ end.should_not raise_error()
47
39
  end
48
40
 
49
41
  it 'raises error if field is not GroupDocs::Signature::Field object' do
@@ -79,8 +71,8 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
79
71
  end
80
72
 
81
73
  describe '#modify_field!' do
82
- let(:field) { GroupDocs::Signature::Field.new }
83
- let(:document) { GroupDocs::Document.new(:file => GroupDocs::Storage::File.new) }
74
+ let(:field) { GroupDocs::Signature::Field.new(:locations=>[GroupDocs::Signature::Field::Location.new]) }
75
+ let(:document) { GroupDocs::Document.new(:file => GroupDocs::Storage::File.new) }
84
76
  let(:recipient) { GroupDocs::Signature::Recipient.new }
85
77
 
86
78
  before(:each) do
@@ -90,7 +82,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
90
82
  it 'accepts access credentials hash' do
91
83
  lambda do
92
84
  subject.modify_field!(field, document, recipient, :client_id => 'client_id', :private_key => 'private_key')
93
- end.should_not raise_error(ArgumentError)
85
+ end.should_not raise_error()
94
86
  end
95
87
 
96
88
  it 'raises error if field is not GroupDocs::Signature::Field object' do
@@ -101,6 +93,10 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
101
93
  lambda { subject.modify_field!(field, 'Document', recipient) }.should raise_error(ArgumentError)
102
94
  end
103
95
 
96
+ it 'raises error if field is not GroupDocs::Signature::Recipient object' do
97
+ lambda { subject.modify_field!(field, document, 'Recipient') }.should raise_error(ArgumentError)
98
+ end
99
+
104
100
  it 'uses field and first field location as payload' do
105
101
  payload = {}
106
102
  location = {}
@@ -133,7 +129,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
133
129
  it 'accepts access credentials hash' do
134
130
  lambda do
135
131
  subject.assign_field!(field, document, assign_from, assign_to, :client_id => 'client_id', :private_key => 'private_key')
136
- end.should_not raise_error(ArgumentError)
132
+ end.should_not raise_error()
137
133
  end
138
134
 
139
135
  it 'raises error if field is not GroupDocs::Signature::Field object' do
@@ -170,7 +166,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
170
166
  it 'accepts access credentials hash' do
171
167
  lambda do
172
168
  subject.delete_field!(field, :client_id => 'client_id', :private_key => 'private_key')
173
- end.should_not raise_error(ArgumentError)
169
+ end.should_not raise_error()
174
170
  end
175
171
  end
176
172
 
@@ -195,7 +191,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
195
191
  it 'accepts access credentials hash' do
196
192
  lambda do
197
193
  subject.modify_field_location!(location, field, *args, :client_id => 'client_id', :private_key => 'private_key')
198
- end.should_not raise_error(ArgumentError)
194
+ end.should_not raise_error()
199
195
  end
200
196
  end
201
197
 
@@ -218,7 +214,7 @@ shared_examples_for GroupDocs::Signature::FieldMethods do
218
214
  it 'accepts access credentials hash' do
219
215
  lambda do
220
216
  subject.delete_field_location!(location, field, :client_id => 'client_id', :private_key => 'private_key')
221
- end.should_not raise_error(ArgumentError)
217
+ end.should_not raise_error()
222
218
  end
223
219
  end
224
220
  end
@@ -8,11 +8,11 @@ shared_examples_for GroupDocs::Signature::RecipientMethods do
8
8
  it 'accepts access credentials hash' do
9
9
  lambda do
10
10
  subject.recipients!({}, :client_id => 'client_id', :private_key => 'private_key')
11
- end.should_not raise_error(ArgumentError)
11
+ end.should_not raise_error()
12
12
  end
13
13
 
14
14
  it 'can be public' do
15
- lambda { subject.recipients!(:public => true) }.should_not raise_error(ArgumentError)
15
+ lambda { subject.recipients!(:public => true) }.should_not raise_error()
16
16
  end
17
17
 
18
18
  it 'returns array of GroupDocs::Signature::Recipient objects' do
@@ -36,7 +36,7 @@ shared_examples_for GroupDocs::Signature::RecipientMethods do
36
36
  it 'accepts access credentials hash' do
37
37
  lambda do
38
38
  subject.remove_recipient!(recipient, :client_id => 'client_id', :private_key => 'private_key')
39
- end.should_not raise_error(ArgumentError)
39
+ end.should_not raise_error()
40
40
  end
41
41
 
42
42
  it 'raises error if recipient is not GroupDocs::Signature::Recipient object' do
@@ -8,11 +8,11 @@ shared_examples_for GroupDocs::Signature::ResourceMethods do
8
8
  it 'accepts access credentials hash' do
9
9
  lambda do
10
10
  described_class.resources!({}, :client_id => 'client_id', :private_key => 'private_key')
11
- end.should_not raise_error(ArgumentError)
11
+ end.should_not raise_error()
12
12
  end
13
13
 
14
14
  it 'allows passing options' do
15
- lambda { described_class.resources!(:status_ids => %w(sdfj943fjof043fj)) }.should_not raise_error(ArgumentError)
15
+ lambda { described_class.resources!(:status_ids => %w(sdfj943fjof043fj)) }.should_not raise_error()
16
16
  end
17
17
 
18
18
  it 'returns resources hash' do
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: 1.9.0
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-20 00:00:00.000000000 Z
12
+ date: 2015-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -64,17 +64,17 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '3.0'
69
+ version: '4.2'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '3.0'
77
+ version: '4.2'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rspec
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -171,7 +171,10 @@ dependencies:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
173
  version: '1.9'
174
- description: Ruby SDK for GroupDocs REST API
174
+ description: Our SDKs seamlessly integrates with your existing Ruby web or mobile
175
+ applications, enabling your users to perform online document viewing, online digital
176
+ signature execution, online document conversion, online document annotation, online
177
+ document comparison as well as online document automation & document assembly.
175
178
  email: marketplace@groupdocs.com
176
179
  executables: []
177
180
  extensions: []
@@ -376,6 +379,7 @@ files:
376
379
  - lib/groupdocs/document/editor.rb
377
380
  - lib/groupdocs/document/field.rb
378
381
  - lib/groupdocs/document/metadata.rb
382
+ - lib/groupdocs/document/option.rb
379
383
  - lib/groupdocs/document/rectangle.rb
380
384
  - lib/groupdocs/document/style.rb
381
385
  - lib/groupdocs/document/view.rb
@@ -483,6 +487,7 @@ files:
483
487
  - spec/support/json/annotation_collaborators_set.json
484
488
  - spec/support/json/annotation_create.json
485
489
  - spec/support/json/annotation_list.json
490
+ - spec/support/json/annotation_marker_move.json
486
491
  - spec/support/json/annotation_move.json
487
492
  - spec/support/json/annotation_remove.json
488
493
  - spec/support/json/annotation_replies_create.json
@@ -529,6 +534,7 @@ files:
529
534
  - spec/support/json/document_views.json
530
535
  - spec/support/json/envelope_get.json
531
536
  - spec/support/json/envelope_logs.json
537
+ - spec/support/json/envelope_recipient_add.json
532
538
  - spec/support/json/envelopes_all.json
533
539
  - spec/support/json/envelopes_resources.json
534
540
  - spec/support/json/file_compress.json