asposecloud 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.project +18 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +21 -0
  6. data/README.md +71 -0
  7. data/Rakefile +1 -0
  8. data/Samples/Barcode/Test_Builder.rb +35 -0
  9. data/Samples/Barcode/Test_Reader.rb +34 -0
  10. data/Samples/Cells/Test_Converter.rb +34 -0
  11. data/Samples/Email/Test_Converter.rb +31 -0
  12. data/Samples/Email/Test_Document.rb +31 -0
  13. data/Samples/Pdf/Test_Converter.rb +38 -0
  14. data/Samples/Pdf/Test_TextEditor.rb +33 -0
  15. data/Samples/Slides/Test_Converter.rb +35 -0
  16. data/Samples/Storage/Test_Folder.rb +42 -0
  17. data/Samples/Words/Test_Converter.rb +34 -0
  18. data/Samples/tasks/Test_Converter.rb +31 -0
  19. data/Samples/tasks/Test_Document.rb +33 -0
  20. data/Tests/Data/barcodeQR.png +0 -0
  21. data/Tests/Data/email_test.eml +21 -0
  22. data/Tests/Data/email_test_attach.eml +64 -0
  23. data/Tests/Data/test_convert_cell.xlsx +0 -0
  24. data/Tests/Data/test_convert_slide.pptx +0 -0
  25. data/Tests/Data/test_convertlocal.docx +0 -0
  26. data/Tests/Data/test_convertlocal.pdf +0 -0
  27. data/Tests/Data/test_file_on_storage.pdf +0 -0
  28. data/Tests/Data/test_replace_text.pdf +0 -0
  29. data/Tests/Data/test_tasks.mpp +0 -0
  30. data/Tests/Data/test_uploadfile.docx +0 -0
  31. data/Tests/Output/barcodeQR.png +0 -0
  32. data/Tests/Output/converted_file.doc +0 -0
  33. data/Tests/Output/converted_file.pdf +0 -0
  34. data/Tests/Output/converted_file.tiff +0 -0
  35. data/Tests/Output/email_test.msg +0 -0
  36. data/Tests/Output/test_convert_slide.png +0 -0
  37. data/Tests/Output/test_file_on_storage.doc +0 -0
  38. data/Tests/Output/testfile.jpeg +0 -0
  39. data/Tests/barcode_tests.rb +45 -0
  40. data/Tests/cell_tests.rb +41 -0
  41. data/Tests/email_tests.rb +43 -0
  42. data/Tests/pdf_tests.rb +76 -0
  43. data/Tests/slide_tests.rb +41 -0
  44. data/Tests/storage_tests.rb +86 -0
  45. data/Tests/tasks_tests.rb +24 -0
  46. data/Tests/word_tests.rb +34 -0
  47. data/asposecloud.gemspec +24 -0
  48. data/lib/Barcode/builder.rb +45 -0
  49. data/lib/Barcode/reader.rb +65 -0
  50. data/lib/Cells/chart_editor.rb +91 -0
  51. data/lib/Cells/convertor.rb +144 -0
  52. data/lib/Cells/extractor.rb +86 -0
  53. data/lib/Cells/text_editor.rb +94 -0
  54. data/lib/Cells/workbook.rb +224 -0
  55. data/lib/Cells/worksheet.rb +375 -0
  56. data/lib/Common/aspose_app.rb +51 -0
  57. data/lib/Common/product.rb +34 -0
  58. data/lib/Common/utils.rb +172 -0
  59. data/lib/Email/converter.rb +50 -0
  60. data/lib/Email/document.rb +67 -0
  61. data/lib/Ocr/extractor.rb +105 -0
  62. data/lib/Pdf/annotation_editor.rb +263 -0
  63. data/lib/Pdf/converter.rb +127 -0
  64. data/lib/Pdf/document.rb +220 -0
  65. data/lib/Pdf/extractor.rb +107 -0
  66. data/lib/Pdf/text_editor.rb +121 -0
  67. data/lib/Slides/converter.rb +79 -0
  68. data/lib/Slides/document.rb +208 -0
  69. data/lib/Slides/extractor.rb +135 -0
  70. data/lib/Storage/folder.rb +128 -0
  71. data/lib/Words/builder.rb +82 -0
  72. data/lib/Words/converter.rb +67 -0
  73. data/lib/Words/document.rb +117 -0
  74. data/lib/Words/extractor.rb +153 -0
  75. data/lib/Words/mail_merge.rb +65 -0
  76. data/lib/aspose_barcode.rb +21 -0
  77. data/lib/aspose_cells.rb +24 -0
  78. data/lib/aspose_common.rb +29 -0
  79. data/lib/aspose_email.rb +20 -0
  80. data/lib/aspose_ocr.rb +21 -0
  81. data/lib/aspose_pdf.rb +23 -0
  82. data/lib/aspose_slides.rb +21 -0
  83. data/lib/aspose_storage.rb +19 -0
  84. data/lib/aspose_tasks.rb +23 -0
  85. data/lib/aspose_words.rb +23 -0
  86. data/lib/asposecloud.rb +29 -0
  87. data/lib/asposecloud/version.rb +3 -0
  88. data/lib/tasks/assignments.rb +71 -0
  89. data/lib/tasks/calendar.rb +56 -0
  90. data/lib/tasks/converter.rb +48 -0
  91. data/lib/tasks/document.rb +143 -0
  92. data/lib/tasks/resources.rb +69 -0
  93. metadata +187 -0
@@ -0,0 +1,29 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ #this file refers all the other necessary files of the aspose.sdk for Ruby.
19
+
20
+ require_relative 'aspose_common'
21
+ require_relative 'aspose_storage'
22
+ require_relative 'aspose_cells'
23
+ require_relative 'aspose_pdf'
24
+ require_relative 'aspose_slides'
25
+ require_relative 'aspose_words'
26
+ require_relative 'aspose_barcode'
27
+ require_relative 'aspose_ocr'
28
+ require_relative 'aspose_email'
29
+ require_relative 'aspose_tasks';
@@ -0,0 +1,3 @@
1
+ module Asposecloud
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,71 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ module Aspose
19
+ module Cloud
20
+ module Tasks
21
+ class Assignments
22
+ def initialize(filename)
23
+ @filename = filename
24
+ raise 'filename not specified.' if filename.empty?
25
+ @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename
26
+ end
27
+
28
+ def get_assignments(folder_name = '', storage_type = 'Aspose', storage_name = '')
29
+ str_uri = "#{@base_uri}/assignments"
30
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
31
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
32
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Assignments']['AssignmentItem']
33
+ end
34
+
35
+ def get_assignment(assignment_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
36
+ raise 'assignment_id not specified.' if assignment_id.nil?
37
+
38
+ str_uri = "#{@base_uri}/assignments/#{assignment_id}"
39
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
40
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
41
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Assignment']
42
+ end
43
+
44
+ def add_assignment(task_id, resource_id, units, folder_name = '', storage_type = 'Aspose', storage_name = '')
45
+ raise 'task_id not specified.' if task_id.nil?
46
+ raise 'resource_id not specified.' if resource_id.nil?
47
+ raise 'units not specified.' if units.nil?
48
+
49
+ str_uri = "#{@base_uri}/assignments"
50
+ qry = { :taskUid => task_id, :resourceUid => resource_id, :units => units }
51
+ str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
52
+
53
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
54
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
55
+
56
+ JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['AssignmentItem']
57
+ end
58
+
59
+ def delete_assignment(assignment_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
60
+ raise 'assignment_id not specified.' if assignment_id.nil?
61
+
62
+ str_uri = "#{@base_uri}/assignments/#{assignment_id}"
63
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
64
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
65
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
66
+ end
67
+
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,56 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ module Aspose
19
+ module Cloud
20
+ module Tasks
21
+ class Calendar
22
+ def initialize(filename)
23
+ @filename = filename
24
+ raise 'filename not specified.' if filename.empty?
25
+ @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename
26
+ end
27
+
28
+ def get_calendars(folder_name = '', storage_type = 'Aspose', storage_name = '')
29
+ str_uri = "#{@base_uri}/calendars"
30
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
31
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
32
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Calendars']['List']
33
+ end
34
+
35
+ def get_calendar(calendar_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
36
+ raise 'calendar_id not specified.' if calendar_id.nil?
37
+
38
+ str_uri = "#{@base_uri}/calendars/#{calendar_id}"
39
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
40
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
41
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Calendar']
42
+ end
43
+
44
+ def delete_calendar(calendar_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
45
+ raise 'calendar_id not specified.' if calendar_id.nil?
46
+
47
+ str_uri = "#{@base_uri}/calendars/#{calendar_id}"
48
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
49
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
50
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
51
+ end
52
+
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,48 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ module Aspose
19
+ module Cloud
20
+ module Tasks
21
+ class Converter
22
+
23
+ def initialize(filename)
24
+ @filename = filename
25
+ raise 'filename not specified.' if filename.empty?
26
+ @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename
27
+ end
28
+
29
+ def convert(save_format, folder_name = '', storage_type = 'Aspose', storage_name = '')
30
+ raise 'save_format not specified.' if save_format.empty?
31
+
32
+ str_uri = "#{@base_uri}?format=#{save_format}"
33
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
34
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
35
+ response_stream = RestClient.get(signed_str_uri, {:accept=>'application/json'})
36
+
37
+ valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
38
+
39
+ if valid_output.empty?
40
+ output_path = "#{Aspose::Cloud::Common::AsposeApp.output_location}#{Aspose::Cloud::Common::Utils.get_filename(@filename)}.#{save_format}"
41
+ Aspose::Cloud::Common::Utils.save_file(response_stream,output_path)
42
+ end
43
+ valid_output
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,143 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ module Aspose
19
+ module Cloud
20
+ module Tasks
21
+ class Document
22
+ def initialize(filename)
23
+ @filename = filename
24
+ raise 'filename not specified.' if filename.empty?
25
+ @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename
26
+ end
27
+
28
+ def get_properties(folder_name = '', storage_type = 'Aspose', storage_name = '')
29
+ str_uri = "#{@base_uri}/documentProperties"
30
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
31
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
32
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Properties']['List']
33
+ end
34
+
35
+ def get_tasks(folder_name = '', storage_type = 'Aspose', storage_name = '')
36
+ str_uri = "#{@base_uri}/tasks"
37
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
38
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
39
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Tasks']['TaskItem']
40
+ end
41
+
42
+ def get_task(task_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
43
+ raise 'task_id not specified.' if task_id.nil?
44
+
45
+ str_uri = "#{@base_uri}/tasks/#{task_id}"
46
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
47
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
48
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Task']
49
+ end
50
+
51
+ def add_task(task_name, before_task_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
52
+ raise 'task_name not specified.' if task_name.nil?
53
+ raise 'before_task_id not specified.' if before_task_id.nil?
54
+
55
+ str_uri = "#{@base_uri}/tasks"
56
+ qry = { :taskName => task_name, :beforeTaskId => before_task_id }
57
+ str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
58
+
59
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
60
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
61
+
62
+ JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['TaskItem']
63
+ end
64
+
65
+ def delete_task(task_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
66
+ raise 'task_id not specified.' if task_id.nil?
67
+
68
+ str_uri = "#{@base_uri}/tasks/#{task_id}"
69
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
70
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
71
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
72
+ end
73
+
74
+ def get_links(folder_name = '', storage_type = 'Aspose', storage_name = '')
75
+ str_uri = "#{@base_uri}/taskLinks"
76
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
77
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
78
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['TaskLinks']
79
+ end
80
+
81
+ def delete_link(link_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
82
+ raise 'link_index not specified.' if link_index.nil?
83
+
84
+ str_uri = "#{@base_uri}/taskLinks/#{link_index}"
85
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
86
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
87
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
88
+ end
89
+
90
+ def get_outline_codes(folder_name = '', storage_type = 'Aspose', storage_name = '')
91
+ str_uri = "#{@base_uri}/outlineCodes"
92
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
93
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
94
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OutlineCodes']
95
+ end
96
+
97
+ def get_outline_code(outline_code_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
98
+ raise 'outline_code_id not specified.' if outline_code_id.nil?
99
+
100
+ str_uri = "#{@base_uri}/outlineCodes/#{outline_code_id}"
101
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
102
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
103
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OutlineCode']
104
+ end
105
+
106
+ def delete_outline_code(outline_code_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
107
+ raise 'outline_code_id not specified.' if outline_code_id.nil?
108
+
109
+ str_uri = "#{@base_uri}/outlineCodes/#{outline_code_id}"
110
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
111
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
112
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
113
+ end
114
+
115
+ def get_extended_attributes(folder_name = '', storage_type = 'Aspose', storage_name = '')
116
+ str_uri = "#{@base_uri}/extendedAttributes"
117
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
118
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
119
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['ExtendedAttributes']
120
+ end
121
+
122
+ def get_extended_attribute(attribute_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
123
+ raise 'attribute_id not specified.' if attribute_id.nil?
124
+
125
+ str_uri = "#{@base_uri}/extendedAttributes/#{attribute_id}"
126
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
127
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
128
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['ExtendedAttribute']
129
+ end
130
+
131
+ def delete_extended_attribute(attribute_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
132
+ raise 'attribute_id not specified.' if attribute_id.nil?
133
+
134
+ str_uri = "#{@base_uri}/extendedAttributes/#{attribute_id}"
135
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
136
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
137
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
138
+ end
139
+
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,69 @@
1
+ # Copyright (c) Aspose 2002-2014. All Rights Reserved.
2
+ #
3
+ # LICENSE: This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU General Public License
5
+ # as published by the Free Software Foundation; either version 3
6
+ # of the License, or (at your option) any later version.
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
13
+ #
14
+ # @package Aspose_Cloud_SDK_For_Ruby
15
+ # @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
16
+ # @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
17
+
18
+ module Aspose
19
+ module Cloud
20
+ module Tasks
21
+ class Resources
22
+ def initialize(filename)
23
+ @filename = filename
24
+ raise 'filename not specified.' if filename.empty?
25
+ @base_uri = Aspose::Cloud::Common::Product.product_uri + '/tasks/' + @filename
26
+ end
27
+
28
+ def get_resources(folder_name = '', storage_type = 'Aspose', storage_name = '')
29
+ str_uri = "#{@base_uri}/resources"
30
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
31
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
32
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Resources']['ResourceItem']
33
+ end
34
+
35
+ def get_resource(resource_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
36
+ raise 'resource_id not specified.' if resource_id.nil?
37
+
38
+ str_uri = "#{@base_uri}/resources/#{resource_id}"
39
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
40
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
41
+ JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Resource']
42
+ end
43
+
44
+ def add_resource(resource_name, after_resource_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
45
+ raise 'resource_name not specified.' if resource_name.empty?
46
+ raise 'after_resource_id not specified.' if after_resource_id.nil?
47
+
48
+ str_uri = "#{@base_uri}/resources"
49
+ qry = { :resourceName => resource_name, :afterResourceId => after_resource_id }
50
+ str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
51
+
52
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
53
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
54
+
55
+ JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['ResourceItem']
56
+ end
57
+
58
+ def delete_resource(resource_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
59
+ raise 'resource_id not specified.' if resource_id.nil?
60
+
61
+ str_uri = "#{@base_uri}/resources/#{resource_id}"
62
+ str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
63
+ signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
64
+ JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
metadata ADDED
@@ -0,0 +1,187 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asposecloud
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Assad Mahmood Qazi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rest-client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Aspose Cloud SDK for Ruby allows you to use Aspose API in your Ruby applications
56
+ email:
57
+ - assadvirgo@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - .project
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - Samples/Barcode/Test_Builder.rb
69
+ - Samples/Barcode/Test_Reader.rb
70
+ - Samples/Cells/Test_Converter.rb
71
+ - Samples/Email/Test_Converter.rb
72
+ - Samples/Email/Test_Document.rb
73
+ - Samples/Pdf/Test_Converter.rb
74
+ - Samples/Pdf/Test_TextEditor.rb
75
+ - Samples/Slides/Test_Converter.rb
76
+ - Samples/Storage/Test_Folder.rb
77
+ - Samples/Words/Test_Converter.rb
78
+ - Samples/tasks/Test_Converter.rb
79
+ - Samples/tasks/Test_Document.rb
80
+ - Tests/Data/barcodeQR.png
81
+ - Tests/Data/email_test.eml
82
+ - Tests/Data/email_test_attach.eml
83
+ - Tests/Data/test_convert_cell.xlsx
84
+ - Tests/Data/test_convert_slide.pptx
85
+ - Tests/Data/test_convertlocal.docx
86
+ - Tests/Data/test_convertlocal.pdf
87
+ - Tests/Data/test_file_on_storage.pdf
88
+ - Tests/Data/test_replace_text.pdf
89
+ - Tests/Data/test_tasks.mpp
90
+ - Tests/Data/test_uploadfile.docx
91
+ - Tests/Output/barcodeQR.png
92
+ - Tests/Output/converted_file.doc
93
+ - Tests/Output/converted_file.pdf
94
+ - Tests/Output/converted_file.tiff
95
+ - Tests/Output/email_test.msg
96
+ - Tests/Output/test_convert_slide.png
97
+ - Tests/Output/test_file_on_storage.doc
98
+ - Tests/Output/testfile.jpeg
99
+ - Tests/barcode_tests.rb
100
+ - Tests/cell_tests.rb
101
+ - Tests/email_tests.rb
102
+ - Tests/pdf_tests.rb
103
+ - Tests/slide_tests.rb
104
+ - Tests/storage_tests.rb
105
+ - Tests/tasks_tests.rb
106
+ - Tests/word_tests.rb
107
+ - asposecloud.gemspec
108
+ - lib/Barcode/builder.rb
109
+ - lib/Barcode/reader.rb
110
+ - lib/Cells/chart_editor.rb
111
+ - lib/Cells/convertor.rb
112
+ - lib/Cells/extractor.rb
113
+ - lib/Cells/text_editor.rb
114
+ - lib/Cells/workbook.rb
115
+ - lib/Cells/worksheet.rb
116
+ - lib/Common/aspose_app.rb
117
+ - lib/Common/product.rb
118
+ - lib/Common/utils.rb
119
+ - lib/Email/converter.rb
120
+ - lib/Email/document.rb
121
+ - lib/Ocr/extractor.rb
122
+ - lib/Pdf/annotation_editor.rb
123
+ - lib/Pdf/converter.rb
124
+ - lib/Pdf/document.rb
125
+ - lib/Pdf/extractor.rb
126
+ - lib/Pdf/text_editor.rb
127
+ - lib/Slides/converter.rb
128
+ - lib/Slides/document.rb
129
+ - lib/Slides/extractor.rb
130
+ - lib/Storage/folder.rb
131
+ - lib/Words/builder.rb
132
+ - lib/Words/converter.rb
133
+ - lib/Words/document.rb
134
+ - lib/Words/extractor.rb
135
+ - lib/Words/mail_merge.rb
136
+ - lib/aspose_barcode.rb
137
+ - lib/aspose_cells.rb
138
+ - lib/aspose_common.rb
139
+ - lib/aspose_email.rb
140
+ - lib/aspose_ocr.rb
141
+ - lib/aspose_pdf.rb
142
+ - lib/aspose_slides.rb
143
+ - lib/aspose_storage.rb
144
+ - lib/aspose_tasks.rb
145
+ - lib/aspose_words.rb
146
+ - lib/asposecloud.rb
147
+ - lib/asposecloud/version.rb
148
+ - lib/tasks/assignments.rb
149
+ - lib/tasks/calendar.rb
150
+ - lib/tasks/converter.rb
151
+ - lib/tasks/document.rb
152
+ - lib/tasks/resources.rb
153
+ homepage: http://www.aspose.com
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
157
+ post_install_message:
158
+ rdoc_options: []
159
+ require_paths:
160
+ - lib
161
+ - lib/Barcode
162
+ - lib/Cells
163
+ - lib/Common
164
+ - lib/Ocr
165
+ - lib/Pdf
166
+ - lib/Slides
167
+ - lib/Storage
168
+ - lib/Words
169
+ - lib/tasks
170
+ - lib/Email
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - '>='
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ requirements: []
182
+ rubyforge_project:
183
+ rubygems_version: 2.0.14
184
+ signing_key:
185
+ specification_version: 4
186
+ summary: Aspose Cloud SDK for Ruby allows you to use Aspose API in your Ruby applications
187
+ test_files: []