uploadcare-ruby 1.2.1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/gem-push.yml +20 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.gitignore +13 -5
- data/.rspec +3 -0
- data/.rubocop.yml +20 -0
- data/.yardopts +4 -0
- data/CHANGELOG.md +25 -24
- data/DEVELOPMENT.md +18 -0
- data/Gemfile +2 -0
- data/LICENSE +1 -1
- data/README.md +191 -519
- data/Rakefile +6 -4
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/uploadcare.rb +36 -26
- data/lib/uploadcare/api/api.rb +25 -0
- data/lib/uploadcare/client/file_client.rb +44 -0
- data/lib/uploadcare/client/file_list_client.rb +46 -0
- data/lib/uploadcare/client/group_client.rb +45 -0
- data/lib/uploadcare/client/multipart_upload/chunks_client.rb +46 -0
- data/lib/uploadcare/client/multipart_upload_client.rb +62 -0
- data/lib/uploadcare/client/project_client.rb +18 -0
- data/lib/uploadcare/client/rest_client.rb +73 -0
- data/lib/uploadcare/client/rest_group_client.rb +23 -0
- data/lib/uploadcare/client/upload_client.rb +35 -0
- data/lib/uploadcare/client/uploader_client.rb +93 -0
- data/lib/uploadcare/client/webhook_client.rb +43 -0
- data/lib/uploadcare/concern/error_handler.rb +54 -0
- data/lib/uploadcare/concern/throttle_handler.rb +25 -0
- data/lib/uploadcare/concern/upload_error_handler.rb +32 -0
- data/lib/uploadcare/entity/decorator/paginator.rb +81 -0
- data/lib/uploadcare/entity/entity.rb +18 -0
- data/lib/uploadcare/entity/file.rb +81 -0
- data/lib/uploadcare/entity/file_list.rb +30 -0
- data/lib/uploadcare/entity/group.rb +41 -0
- data/lib/uploadcare/entity/group_list.rb +24 -0
- data/lib/uploadcare/entity/project.rb +13 -0
- data/lib/uploadcare/entity/uploader.rb +73 -0
- data/lib/uploadcare/entity/webhook.rb +14 -0
- data/lib/uploadcare/exception/request_error.rb +9 -0
- data/lib/uploadcare/exception/throttle_error.rb +14 -0
- data/lib/uploadcare/param/authentication_header.rb +25 -0
- data/lib/uploadcare/param/param.rb +10 -0
- data/lib/uploadcare/param/secure_auth_header.rb +37 -0
- data/lib/uploadcare/param/simple_auth_header.rb +14 -0
- data/lib/uploadcare/param/upload/signature_generator.rb +24 -0
- data/lib/uploadcare/param/upload/upload_params_generator.rb +23 -0
- data/lib/uploadcare/param/user_agent.rb +21 -0
- data/lib/uploadcare/ruby/version.rb +5 -0
- data/uploadcare-ruby.gemspec +50 -36
- metadata +112 -96
- data/.travis.yml +0 -12
- data/lib/uploadcare/api.rb +0 -24
- data/lib/uploadcare/api/file_api.rb +0 -7
- data/lib/uploadcare/api/file_list_api.rb +0 -8
- data/lib/uploadcare/api/group_api.rb +0 -38
- data/lib/uploadcare/api/group_list_api.rb +0 -8
- data/lib/uploadcare/api/project_api.rb +0 -9
- data/lib/uploadcare/api/raw_api.rb +0 -44
- data/lib/uploadcare/api/uploading_api.rb +0 -110
- data/lib/uploadcare/errors/errors.rb +0 -64
- data/lib/uploadcare/resources/file.rb +0 -164
- data/lib/uploadcare/resources/file_list.rb +0 -41
- data/lib/uploadcare/resources/group.rb +0 -115
- data/lib/uploadcare/resources/group_list.rb +0 -31
- data/lib/uploadcare/resources/project.rb +0 -13
- data/lib/uploadcare/rest/auth/auth.rb +0 -31
- data/lib/uploadcare/rest/auth/secure.rb +0 -43
- data/lib/uploadcare/rest/auth/simple.rb +0 -16
- data/lib/uploadcare/rest/connections/api_connection.rb +0 -32
- data/lib/uploadcare/rest/connections/upload_connection.rb +0 -21
- data/lib/uploadcare/rest/middlewares/auth_middleware.rb +0 -24
- data/lib/uploadcare/rest/middlewares/parse_json_middleware.rb +0 -33
- data/lib/uploadcare/rest/middlewares/raise_error_middleware.rb +0 -21
- data/lib/uploadcare/utils/parser.rb +0 -71
- data/lib/uploadcare/utils/user_agent.rb +0 -44
- data/lib/uploadcare/version.rb +0 -3
- data/spec/api/raw_api_spec.rb +0 -25
- data/spec/resources/file_list_spec.rb +0 -64
- data/spec/resources/file_spec.rb +0 -222
- data/spec/resources/group_list_spec.rb +0 -30
- data/spec/resources/group_spec.rb +0 -101
- data/spec/resources/operations_spec.rb +0 -59
- data/spec/resources/project_spec.rb +0 -21
- data/spec/rest/api_connection_spec.rb +0 -68
- data/spec/rest/auth/secure_spec.rb +0 -66
- data/spec/rest/auth/simple_spec.rb +0 -31
- data/spec/rest/errors_spec.rb +0 -75
- data/spec/rest/upload_connection_spec.rb +0 -19
- data/spec/spec_helper.rb +0 -41
- data/spec/uploadcare_spec.rb +0 -16
- data/spec/uploading/uploading_multiple_spec.rb +0 -43
- data/spec/uploading/uploading_spec.rb +0 -40
- data/spec/utils/parser_spec.rb +0 -87
- data/spec/utils/user_agent_spec.rb +0 -46
- data/spec/view.png +0 -0
- data/spec/view2.jpg +0 -0
metadata
CHANGED
@@ -1,47 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uploadcare-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- "@dimituri (Dimitry Solovyov)"
|
9
|
-
- "@romanonthego (Roman Dubinin)"
|
7
|
+
- Stepan Redka
|
10
8
|
autorequire:
|
11
|
-
bindir:
|
9
|
+
bindir: exe
|
12
10
|
cert_chain: []
|
13
|
-
date:
|
11
|
+
date: 2021-04-15 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
14
|
+
name: api_struct
|
17
15
|
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 1.0.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
23
|
requirements:
|
26
24
|
- - "~>"
|
27
25
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
26
|
+
version: 1.0.1
|
29
27
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
28
|
+
name: dry-configurable
|
31
29
|
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
31
|
- - "~>"
|
34
32
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
33
|
+
version: 0.9.0
|
36
34
|
type: :runtime
|
37
35
|
prerelease: false
|
38
36
|
version_requirements: !ruby/object:Gem::Requirement
|
39
37
|
requirements:
|
40
38
|
- - "~>"
|
41
39
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
40
|
+
version: 0.9.0
|
43
41
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
42
|
+
name: parallel
|
45
43
|
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - ">="
|
@@ -55,7 +53,7 @@ dependencies:
|
|
55
53
|
- !ruby/object:Gem::Version
|
56
54
|
version: '0'
|
57
55
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
56
|
+
name: retries
|
59
57
|
requirement: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
59
|
- - ">="
|
@@ -68,22 +66,64 @@ dependencies:
|
|
68
66
|
- - ">="
|
69
67
|
- !ruby/object:Gem::Version
|
70
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '13.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '13.0'
|
71
97
|
- !ruby/object:Gem::Dependency
|
72
98
|
name: rspec
|
73
99
|
requirement: !ruby/object:Gem::Requirement
|
74
100
|
requirements:
|
75
101
|
- - "~>"
|
76
102
|
- !ruby/object:Gem::Version
|
77
|
-
version: '3'
|
103
|
+
version: '3.0'
|
78
104
|
type: :development
|
79
105
|
prerelease: false
|
80
106
|
version_requirements: !ruby/object:Gem::Requirement
|
81
107
|
requirements:
|
82
108
|
- - "~>"
|
83
109
|
- !ruby/object:Gem::Version
|
84
|
-
version: '3'
|
110
|
+
version: '3.0'
|
85
111
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: vcr
|
87
127
|
requirement: !ruby/object:Gem::Requirement
|
88
128
|
requirements:
|
89
129
|
- - ">="
|
@@ -97,7 +137,7 @@ dependencies:
|
|
97
137
|
- !ruby/object:Gem::Version
|
98
138
|
version: '0'
|
99
139
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
140
|
+
name: webmock
|
101
141
|
requirement: !ruby/object:Gem::Requirement
|
102
142
|
requirements:
|
103
143
|
- - ">="
|
@@ -110,80 +150,77 @@ dependencies:
|
|
110
150
|
- - ">="
|
111
151
|
- !ruby/object:Gem::Version
|
112
152
|
version: '0'
|
113
|
-
description:
|
114
|
-
\ Full documentations on APIs can be found\n at
|
115
|
-
https://uploadcare.com/documentation/rest/\n and https://uploadcare.com/documentation/upload/\n"
|
153
|
+
description: Ruby wrapper for uploadcare API
|
116
154
|
email:
|
117
|
-
-
|
155
|
+
- stepan.redka@railsmuffin.com
|
118
156
|
executables: []
|
119
157
|
extensions: []
|
120
158
|
extra_rdoc_files: []
|
121
159
|
files:
|
122
|
-
- ".
|
160
|
+
- ".github/workflows/gem-push.yml"
|
161
|
+
- ".github/workflows/ruby.yml"
|
123
162
|
- ".gitignore"
|
124
|
-
- ".
|
163
|
+
- ".rspec"
|
164
|
+
- ".rubocop.yml"
|
165
|
+
- ".yardopts"
|
125
166
|
- CHANGELOG.md
|
167
|
+
- DEVELOPMENT.md
|
126
168
|
- Gemfile
|
127
169
|
- LICENSE
|
128
170
|
- README.md
|
129
171
|
- Rakefile
|
172
|
+
- bin/console
|
173
|
+
- bin/setup
|
130
174
|
- lib/uploadcare.rb
|
131
|
-
- lib/uploadcare/api.rb
|
132
|
-
- lib/uploadcare/
|
133
|
-
- lib/uploadcare/
|
134
|
-
- lib/uploadcare/
|
135
|
-
- lib/uploadcare/
|
136
|
-
- lib/uploadcare/
|
137
|
-
- lib/uploadcare/
|
138
|
-
- lib/uploadcare/
|
139
|
-
- lib/uploadcare/
|
140
|
-
- lib/uploadcare/
|
141
|
-
- lib/uploadcare/
|
142
|
-
- lib/uploadcare/
|
143
|
-
- lib/uploadcare/
|
144
|
-
- lib/uploadcare/
|
145
|
-
- lib/uploadcare/
|
146
|
-
- lib/uploadcare/
|
147
|
-
- lib/uploadcare/
|
148
|
-
- lib/uploadcare/
|
149
|
-
- lib/uploadcare/
|
150
|
-
- lib/uploadcare/
|
151
|
-
- lib/uploadcare/
|
152
|
-
- lib/uploadcare/
|
153
|
-
- lib/uploadcare/
|
154
|
-
- lib/uploadcare/
|
155
|
-
- lib/uploadcare/
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
159
|
-
-
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
- spec/rest/auth/simple_spec.rb
|
166
|
-
- spec/rest/errors_spec.rb
|
167
|
-
- spec/rest/upload_connection_spec.rb
|
168
|
-
- spec/spec_helper.rb
|
169
|
-
- spec/uploadcare_spec.rb
|
170
|
-
- spec/uploading/uploading_multiple_spec.rb
|
171
|
-
- spec/uploading/uploading_spec.rb
|
172
|
-
- spec/utils/parser_spec.rb
|
173
|
-
- spec/utils/user_agent_spec.rb
|
174
|
-
- spec/view.png
|
175
|
-
- spec/view2.jpg
|
175
|
+
- lib/uploadcare/api/api.rb
|
176
|
+
- lib/uploadcare/client/file_client.rb
|
177
|
+
- lib/uploadcare/client/file_list_client.rb
|
178
|
+
- lib/uploadcare/client/group_client.rb
|
179
|
+
- lib/uploadcare/client/multipart_upload/chunks_client.rb
|
180
|
+
- lib/uploadcare/client/multipart_upload_client.rb
|
181
|
+
- lib/uploadcare/client/project_client.rb
|
182
|
+
- lib/uploadcare/client/rest_client.rb
|
183
|
+
- lib/uploadcare/client/rest_group_client.rb
|
184
|
+
- lib/uploadcare/client/upload_client.rb
|
185
|
+
- lib/uploadcare/client/uploader_client.rb
|
186
|
+
- lib/uploadcare/client/webhook_client.rb
|
187
|
+
- lib/uploadcare/concern/error_handler.rb
|
188
|
+
- lib/uploadcare/concern/throttle_handler.rb
|
189
|
+
- lib/uploadcare/concern/upload_error_handler.rb
|
190
|
+
- lib/uploadcare/entity/decorator/paginator.rb
|
191
|
+
- lib/uploadcare/entity/entity.rb
|
192
|
+
- lib/uploadcare/entity/file.rb
|
193
|
+
- lib/uploadcare/entity/file_list.rb
|
194
|
+
- lib/uploadcare/entity/group.rb
|
195
|
+
- lib/uploadcare/entity/group_list.rb
|
196
|
+
- lib/uploadcare/entity/project.rb
|
197
|
+
- lib/uploadcare/entity/uploader.rb
|
198
|
+
- lib/uploadcare/entity/webhook.rb
|
199
|
+
- lib/uploadcare/exception/request_error.rb
|
200
|
+
- lib/uploadcare/exception/throttle_error.rb
|
201
|
+
- lib/uploadcare/param/authentication_header.rb
|
202
|
+
- lib/uploadcare/param/param.rb
|
203
|
+
- lib/uploadcare/param/secure_auth_header.rb
|
204
|
+
- lib/uploadcare/param/simple_auth_header.rb
|
205
|
+
- lib/uploadcare/param/upload/signature_generator.rb
|
206
|
+
- lib/uploadcare/param/upload/upload_params_generator.rb
|
207
|
+
- lib/uploadcare/param/user_agent.rb
|
208
|
+
- lib/uploadcare/ruby/version.rb
|
176
209
|
- uploadcare-ruby.gemspec
|
177
|
-
homepage: https://
|
210
|
+
homepage: https://github.com/uploadcare/uploadcare-ruby
|
178
211
|
licenses:
|
179
212
|
- MIT
|
180
213
|
metadata:
|
181
|
-
|
182
|
-
|
214
|
+
allowed_push_host: https://rubygems.org
|
215
|
+
homepage_uri: https://github.com/uploadcare/uploadcare-ruby
|
216
|
+
source_code_uri: https://github.com/uploadcare/uploadcare-ruby
|
217
|
+
changelog_uri: https://github.com/uploadcare/uploadcare-ruby/CHANGELOG.md
|
183
218
|
post_install_message:
|
184
219
|
rdoc_options: []
|
185
220
|
require_paths:
|
186
221
|
- lib
|
222
|
+
- lib/uploadcare
|
223
|
+
- lib/uploadcare/rest
|
187
224
|
required_ruby_version: !ruby/object:Gem::Requirement
|
188
225
|
requirements:
|
189
226
|
- - ">="
|
@@ -195,29 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
232
|
- !ruby/object:Gem::Version
|
196
233
|
version: '0'
|
197
234
|
requirements: []
|
198
|
-
|
199
|
-
rubygems_version: 2.5.2
|
235
|
+
rubygems_version: 3.0.1
|
200
236
|
signing_key:
|
201
237
|
specification_version: 4
|
202
|
-
summary: Ruby
|
203
|
-
test_files:
|
204
|
-
- spec/api/raw_api_spec.rb
|
205
|
-
- spec/resources/file_list_spec.rb
|
206
|
-
- spec/resources/file_spec.rb
|
207
|
-
- spec/resources/group_list_spec.rb
|
208
|
-
- spec/resources/group_spec.rb
|
209
|
-
- spec/resources/operations_spec.rb
|
210
|
-
- spec/resources/project_spec.rb
|
211
|
-
- spec/rest/api_connection_spec.rb
|
212
|
-
- spec/rest/auth/secure_spec.rb
|
213
|
-
- spec/rest/auth/simple_spec.rb
|
214
|
-
- spec/rest/errors_spec.rb
|
215
|
-
- spec/rest/upload_connection_spec.rb
|
216
|
-
- spec/spec_helper.rb
|
217
|
-
- spec/uploadcare_spec.rb
|
218
|
-
- spec/uploading/uploading_multiple_spec.rb
|
219
|
-
- spec/uploading/uploading_spec.rb
|
220
|
-
- spec/utils/parser_spec.rb
|
221
|
-
- spec/utils/user_agent_spec.rb
|
222
|
-
- spec/view.png
|
223
|
-
- spec/view2.jpg
|
238
|
+
summary: Ruby wrapper for uploadcare API
|
239
|
+
test_files: []
|
data/.travis.yml
DELETED
data/lib/uploadcare/api.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'ostruct'
|
3
|
-
Dir[File.dirname(__FILE__) + '/utils/*.rb'].each {|file| require file }
|
4
|
-
Dir[File.dirname(__FILE__) + '/errors/*.rb'].each {|file| require file }
|
5
|
-
Dir[File.dirname(__FILE__) + '/rest/middlewares/*.rb'].each {|file| require file }
|
6
|
-
Dir[File.dirname(__FILE__) + '/rest/connections/*.rb'].each {|file| require file }
|
7
|
-
Dir[File.dirname(__FILE__) + '/rest/auth/*.rb'].sort.each {|file| require file }
|
8
|
-
Dir[File.dirname(__FILE__) + '/api/*.rb'].each {|file| require file }
|
9
|
-
Dir[File.dirname(__FILE__) + '/resources/*.rb'].each {|file| require file }
|
10
|
-
|
11
|
-
|
12
|
-
module Uploadcare
|
13
|
-
class Api
|
14
|
-
attr_reader :options
|
15
|
-
|
16
|
-
include Uploadcare::RawApi
|
17
|
-
include Uploadcare::UploadingApi
|
18
|
-
include Uploadcare::FileApi
|
19
|
-
include Uploadcare::ProjectApi
|
20
|
-
include Uploadcare::FileListApi
|
21
|
-
include Uploadcare::GroupApi
|
22
|
-
include Uploadcare::GroupListApi
|
23
|
-
end
|
24
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Uploadcare
|
2
|
-
module GroupApi
|
3
|
-
|
4
|
-
def group uuid_or_cdn_url
|
5
|
-
group = Uploadcare::Api::Group.new self, uuid_or_cdn_url
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
def create_group ary
|
10
|
-
unless ary.kind_of?(Array)
|
11
|
-
raise ArgumentError.new "You should send and array of files or valid UUIDs"
|
12
|
-
else
|
13
|
-
if ary.select {|f| !!f.kind_of?(Uploadcare::Api::File) }.any?
|
14
|
-
files = Hash.new
|
15
|
-
ary.each_with_index do |file, i|
|
16
|
-
files["files[#{i}]"] = file.uuid
|
17
|
-
end
|
18
|
-
elsif ary.select {|f| !!f.kind_of?(String) }.any?
|
19
|
-
files = Hash.new
|
20
|
-
ary.each_with_index do |uuid, i|
|
21
|
-
files["files[#{i}]"] = uuid
|
22
|
-
end
|
23
|
-
else
|
24
|
-
raise ArgumentError.new "You should send and array of files or valid UUIDs"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
data = {
|
30
|
-
pub_key: @options[:public_key],
|
31
|
-
}
|
32
|
-
|
33
|
-
data.merge! files
|
34
|
-
post = @upload_connection.send :post, "/group/", data
|
35
|
-
group = Uploadcare::Api::Group.new self, post.body["id"], post.body
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
module Uploadcare
|
4
|
-
module RawApi
|
5
|
-
|
6
|
-
def initialize options={}
|
7
|
-
@options = Uploadcare::default_settings.merge(options)
|
8
|
-
@api_connection = Uploadcare::Connections::ApiConnection.new(@options)
|
9
|
-
@upload_connection = Uploadcare::Connections::UploadConnection.new(@options)
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
# basic request method
|
14
|
-
def request method = :get, path = "/files/", params = {}
|
15
|
-
response = @api_connection.send method, path, params
|
16
|
-
response.body
|
17
|
-
end
|
18
|
-
alias_method :api_request, :request
|
19
|
-
|
20
|
-
|
21
|
-
# request with GET verb
|
22
|
-
def get path= "/files/", params={}
|
23
|
-
request :get, path, params
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
# request with POST verb
|
28
|
-
def post path= "/files/", params={}
|
29
|
-
request :post, path, params
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
# request with PUT verb
|
34
|
-
def put path= "/files/", params={}
|
35
|
-
request :put, path, params
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
# request with DELETE verb
|
40
|
-
def delete path= "/files/", params={}
|
41
|
-
request :delete, path, params
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|