uploadcare-rails 2.1.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uploadcare/rails/api/rest/addons_api.rb +54 -0
- data/lib/uploadcare/rails/api/rest/base.rb +3 -2
- data/lib/uploadcare/rails/api/rest/conversion_api.rb +8 -8
- data/lib/uploadcare/rails/api/rest/file_api.rb +20 -13
- data/lib/uploadcare/rails/api/rest/file_metadata_api.rb +42 -0
- data/lib/uploadcare/rails/api/rest/group_api.rb +12 -6
- data/lib/uploadcare/rails/api/rest/project_api.rb +1 -1
- data/lib/uploadcare/rails/api/rest/webhook_api.rb +6 -6
- data/lib/uploadcare/rails/api/upload/base.rb +2 -0
- data/lib/uploadcare/rails/api/upload/upload_api.rb +4 -4
- data/lib/uploadcare/rails/configuration.rb +3 -1
- data/lib/uploadcare/rails/objects/group.rb +1 -3
- data/lib/uploadcare/rails/transformations/image_transformations.rb +1 -1
- data/lib/uploadcare/rails/version.rb +1 -1
- data/lib/uploadcare-rails.rb +2 -0
- metadata +31 -126
- data/spec/fixtures/kitten.jpeg +0 -0
- data/spec/fixtures/vcr_cassettes/conversion_api_convert_document.yml +0 -62
- data/spec/fixtures/vcr_cassettes/conversion_api_convert_document_with_error.yml +0 -62
- data/spec/fixtures/vcr_cassettes/conversion_api_convert_video.yml +0 -62
- data/spec/fixtures/vcr_cassettes/conversion_api_convert_video_with_error.yml +0 -62
- data/spec/fixtures/vcr_cassettes/conversion_api_get_document_conversion_status.yml +0 -59
- data/spec/fixtures/vcr_cassettes/conversion_api_get_video_conversion_status.yml +0 -59
- data/spec/fixtures/vcr_cassettes/file_api_copy_file.yml +0 -60
- data/spec/fixtures/vcr_cassettes/file_api_delete_file.yml +0 -58
- data/spec/fixtures/vcr_cassettes/file_api_delete_files.yml +0 -58
- data/spec/fixtures/vcr_cassettes/file_api_get_file.yml +0 -58
- data/spec/fixtures/vcr_cassettes/file_api_get_files.yml +0 -61
- data/spec/fixtures/vcr_cassettes/file_api_load_file.yml +0 -57
- data/spec/fixtures/vcr_cassettes/file_api_store_file.yml +0 -58
- data/spec/fixtures/vcr_cassettes/file_api_store_files.yml +0 -57
- data/spec/fixtures/vcr_cassettes/group_api_create_group.yml +0 -57
- data/spec/fixtures/vcr_cassettes/group_api_get_group.yml +0 -52
- data/spec/fixtures/vcr_cassettes/group_api_get_groups.yml +0 -57
- data/spec/fixtures/vcr_cassettes/group_api_store_group.yml +0 -57
- data/spec/fixtures/vcr_cassettes/project_api_get_project.yml +0 -59
- data/spec/fixtures/vcr_cassettes/upload_upload_many_files.yml +0 -55
- data/spec/fixtures/vcr_cassettes/upload_upload_one_file.yml +0 -105
- data/spec/fixtures/vcr_cassettes/upload_upload_one_file_from_cdn.yml +0 -111
- data/spec/fixtures/vcr_cassettes/webhook_api_create_webhook.yml +0 -59
- data/spec/fixtures/vcr_cassettes/webhook_api_delete_webhook.yml +0 -57
- data/spec/fixtures/vcr_cassettes/webhook_api_get_webhooks.yml +0 -59
- data/spec/fixtures/vcr_cassettes/webhook_api_update_webhook.yml +0 -59
- data/spec/generators/uploadcare_config_generator_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -26
- data/spec/support/generators.rb +0 -41
- data/spec/support/vcr.rb +0 -14
- data/spec/uploadcare/rails/action_view/uploadcare_uploader_tags_spec.rb +0 -40
- data/spec/uploadcare/rails/action_view/uploadcare_widget_tags_spec.rb +0 -46
- data/spec/uploadcare/rails/active_record/mount_uploadcare_file_spec.rb +0 -33
- data/spec/uploadcare/rails/active_record/mount_uploadcare_group_spec.rb +0 -32
- data/spec/uploadcare/rails/api/rest/conversion_api_spec.rb +0 -110
- data/spec/uploadcare/rails/api/rest/file_api_spec.rb +0 -85
- data/spec/uploadcare/rails/api/rest/group_api_spec.rb +0 -61
- data/spec/uploadcare/rails/api/rest/project_api_spec.rb +0 -33
- data/spec/uploadcare/rails/api/rest/webhook_api_spec.rb +0 -67
- data/spec/uploadcare/rails/api/upload/upload_api_spec.rb +0 -82
- data/spec/uploadcare/rails/jobs/delete_file_job_spec.rb +0 -15
- data/spec/uploadcare/rails/jobs/store_file_job_spec.rb +0 -15
- data/spec/uploadcare/rails/jobs/store_group_job_spec.rb +0 -15
- data/spec/uploadcare/rails/objects/file_spec.rb +0 -77
- data/spec/uploadcare/rails/objects/group_spec.rb +0 -87
- data/spec/uploadcare/rails/services/id_extractor_spec.rb +0 -26
- data/spec/uploadcare/rails/transformations/image_transformations_spec.rb +0 -120
- data/spec/uploadcare/rails_spec.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8244c46a6ef52e75965e01f0cfe4471c998e57b6243d220ee2a20ea4a2c088fb
|
4
|
+
data.tar.gz: bc192f9e03115994b300f32a7de2fe31e033efc5b04df3de54f0efc8d4790775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a717bf7a7f5ca9f0a9ca683583fa554e0d25145e35dc994520be5e290247a13e4eec22faf19ab2a1883a3fd7c01df0624256889d0ef1af3583d616a303134bb
|
7
|
+
data.tar.gz: 30ceb8ee793d456914cb051ffc907bd18639bdf44d06ac9456ee8a2fe05de45054215db6899db6e46a8d8a3a13b29f4ede28de93d14e6e1e92562df73090cb1f
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uploadcare/rails/api/rest/base'
|
4
|
+
|
5
|
+
module Uploadcare
|
6
|
+
module Rails
|
7
|
+
module Api
|
8
|
+
module Rest
|
9
|
+
# A class that contains AddonsApi related methods for Uploadcare REST API
|
10
|
+
class AddonsApi < Base
|
11
|
+
class << self
|
12
|
+
# Execute ClamAV virus checking Add-On for a given target.
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/ucClamavVirusScanExecute
|
14
|
+
def virus_scan(uuid, params = {})
|
15
|
+
Uploadcare::Addons.uc_clamav_virus_scan(uuid, params)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Check the status of an Add-On execution request that had been started using the Execute Add-On operation.
|
19
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/ucClamavVirusScanExecutionStatus
|
20
|
+
def virus_scan_status(uuid)
|
21
|
+
Uploadcare::Addons.uc_clamav_virus_scan_status(uuid)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Execute AWS Rekognition Add-On for a given target to detect labels in an image.
|
25
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/awsRekognitionExecute
|
26
|
+
def rekognition_detect_labels(uuid)
|
27
|
+
Uploadcare::Addons.ws_rekognition_detect_labels(uuid)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Check the status of an Add-On execution request that had been started using the Execute Add-On operation.
|
31
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/awsRekognitionExecutionStatus
|
32
|
+
def rekognition_detect_labels_status(uuid)
|
33
|
+
Uploadcare::Addons.ws_rekognition_detect_labels_status(uuid)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Execute remove.bg background image removal Add-On for a given target.
|
37
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/removeBgExecute
|
38
|
+
def remove_bg(uuid, params = {})
|
39
|
+
Uploadcare::Addons.remove_bg(uuid, params)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Check the status of an Add-On execution request that had been started using the Execute Add-On operation.
|
43
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/removeBgExecutionStatus
|
44
|
+
def remove_bg_status(uuid)
|
45
|
+
Uploadcare::Addons.remove_bg_status(uuid)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
Uploadcare::AddonsApi = Uploadcare::Rails::Api::Rest::AddonsApi
|
@@ -10,25 +10,25 @@ module Uploadcare
|
|
10
10
|
class ConversionApi < Base
|
11
11
|
class << self
|
12
12
|
# Converts video files
|
13
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
14
|
-
def convert_video(video_params,
|
15
|
-
Uploadcare::VideoConverter.convert(video_params,
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/videoConvert
|
14
|
+
def convert_video(video_params, options = {})
|
15
|
+
Uploadcare::VideoConverter.convert(video_params, options)
|
16
16
|
end
|
17
17
|
|
18
18
|
# Returns a status of video conversion job
|
19
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
19
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/videoConvertStatus
|
20
20
|
def get_video_conversion_status(token)
|
21
21
|
Uploadcare::VideoConverter.status(token)
|
22
22
|
end
|
23
23
|
|
24
24
|
# Converts documents
|
25
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
26
|
-
def convert_document(document_params,
|
27
|
-
Uploadcare::DocumentConverter.convert(document_params,
|
25
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/documentConvert
|
26
|
+
def convert_document(document_params, options = {})
|
27
|
+
Uploadcare::DocumentConverter.convert(document_params, options)
|
28
28
|
end
|
29
29
|
|
30
30
|
# Returns a status of video conversion job
|
31
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
31
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/documentConvertStatus
|
32
32
|
def get_document_conversion_status(token)
|
33
33
|
Uploadcare::DocumentConverter.status(token)
|
34
34
|
end
|
@@ -10,51 +10,58 @@ module Uploadcare
|
|
10
10
|
class FileApi < Base
|
11
11
|
class << self
|
12
12
|
# Returns a pagination json of files stored in project
|
13
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesList
|
14
14
|
#
|
15
15
|
# valid options:
|
16
16
|
# removed: [true|false]
|
17
17
|
# stored: [true|false]
|
18
18
|
# limit: (1..1000)
|
19
|
-
# ordering: ["datetime_uploaded"|"-datetime_uploaded"
|
19
|
+
# ordering: ["datetime_uploaded"|"-datetime_uploaded"]
|
20
20
|
# from: A starting point for filtering files. The value depends on your ordering parameter value.
|
21
|
-
def get_files(
|
22
|
-
Uploadcare::FileList.file_list(
|
21
|
+
def get_files(options = {})
|
22
|
+
Uploadcare::FileList.file_list(options)
|
23
23
|
end
|
24
24
|
|
25
25
|
# Acquire file info
|
26
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
26
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/fileInfo
|
27
27
|
def get_file(uuid)
|
28
28
|
Uploadcare::File.info(uuid)
|
29
29
|
end
|
30
30
|
|
31
|
-
# '
|
31
|
+
# 'local_copy' method is used to copy original files or their modified versions to a default storage.
|
32
32
|
# Source files MAY either be stored or just uploaded and MUST NOT be deleted.
|
33
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
34
|
-
def
|
35
|
-
Uploadcare::File.
|
33
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/File/operation/createLocalCopy
|
34
|
+
def local_copy_file(source, options = {})
|
35
|
+
Uploadcare::File.local_copy(source, options)
|
36
36
|
end
|
37
37
|
|
38
|
-
#
|
38
|
+
# 'remote_copy' method is used to copy original files or their modified versions to a custom storage.
|
39
|
+
# Source files MAY either be stored or just uploaded and MUST NOT be deleted.
|
40
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/File/operation/createRemoteCopy
|
41
|
+
def remote_copy_file(source, target, options = {})
|
42
|
+
Uploadcare::File.remote_copy(source, target, options)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/deleteFile
|
39
46
|
def delete_file(uuid)
|
40
47
|
Uploadcare::File.delete(uuid)
|
41
48
|
end
|
42
49
|
|
43
50
|
# Store a single file, preventing it from being deleted in 2 weeks
|
44
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
51
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/storeFile
|
45
52
|
def store_file(uuid)
|
46
53
|
Uploadcare::File.store(uuid)
|
47
54
|
end
|
48
55
|
|
49
56
|
# Make a set of files "stored". This will prevent them from being deleted automatically
|
50
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
57
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesStoring
|
51
58
|
# uuids: Array
|
52
59
|
def store_files(uuids)
|
53
60
|
Uploadcare::FileList.batch_store(uuids)
|
54
61
|
end
|
55
62
|
|
56
63
|
# Delete several files by list of uids
|
57
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
64
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesDelete
|
58
65
|
# uuids: Array
|
59
66
|
def delete_files(uuids)
|
60
67
|
Uploadcare::FileList.batch_delete(uuids)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uploadcare/rails/api/rest/base'
|
4
|
+
|
5
|
+
module Uploadcare
|
6
|
+
module Rails
|
7
|
+
module Api
|
8
|
+
module Rest
|
9
|
+
# A class that contains FileMetadata related methods for Uploadcare REST API
|
10
|
+
class FileMetadataApi < Base
|
11
|
+
class << self
|
12
|
+
# Get file's metadata keys and values
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/fileMetadata
|
14
|
+
def file_metadata(uuid)
|
15
|
+
Uploadcare::FileMetadata.index(uuid)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Get the value of a single metadata key
|
19
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/fileMetadataKey
|
20
|
+
def file_metadata_value(uuid, key)
|
21
|
+
Uploadcare::FileMetadata.show(uuid, key)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Update the value of a single metadata key. If the key does not exist, it will be created
|
25
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/updateFileMetadataKey
|
26
|
+
def update_file_metadata(uuid, key, value)
|
27
|
+
Uploadcare::FileMetadata.update(uuid, key, value)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Delete a file's metadata key
|
31
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/deleteFileMetadataKey
|
32
|
+
def delete_file_metadata(uuid, key)
|
33
|
+
Uploadcare::FileMetadata.delete(uuid, key)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
Uploadcare::FileMetadataApi = Uploadcare::Rails::Api::Rest::FileMetadataApi
|
@@ -10,15 +10,15 @@ module Uploadcare
|
|
10
10
|
class GroupApi < Base
|
11
11
|
class << self
|
12
12
|
# Returns paginated list of groups
|
13
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/groupsList
|
14
14
|
#
|
15
15
|
# valid options:
|
16
16
|
# limit: (1..1000)
|
17
17
|
# ordering: ["datetime_created"|"-datetime_created"]
|
18
18
|
# from: A starting point for filtering group lists. MUST be a datetime value with T used as a separator.
|
19
19
|
# example: '2015-01-02T10:00:00'
|
20
|
-
def get_groups(
|
21
|
-
Uploadcare::GroupList.list(
|
20
|
+
def get_groups(options = {})
|
21
|
+
Uploadcare::GroupList.list(options)
|
22
22
|
end
|
23
23
|
|
24
24
|
# Get group info
|
@@ -28,15 +28,21 @@ module Uploadcare
|
|
28
28
|
end
|
29
29
|
|
30
30
|
# Stores all files in a group
|
31
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
31
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/Group/paths/~1groups~1%3Cuuid%3E~1storage~1/put
|
32
32
|
def store_group(uuid)
|
33
33
|
Uploadcare::Group.store(uuid)
|
34
34
|
end
|
35
35
|
|
36
|
+
# Delete a file group by its ID.
|
37
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/deleteGroup
|
38
|
+
def delete_group(uuid)
|
39
|
+
Uploadcare::Group.delete(uuid)
|
40
|
+
end
|
41
|
+
|
36
42
|
# Create files group from a set of files by using their UUIDs.
|
37
43
|
# @see https://uploadcare.com/api-refs/upload-api/#operation/createFilesGroup
|
38
|
-
def create_group(files,
|
39
|
-
Uploadcare::Group.create(files,
|
44
|
+
def create_group(files, options = {})
|
45
|
+
Uploadcare::Group.create(files, options)
|
40
46
|
end
|
41
47
|
end
|
42
48
|
end
|
@@ -11,7 +11,7 @@ module Uploadcare
|
|
11
11
|
class << self
|
12
12
|
# Get information about the current project.
|
13
13
|
# Current project is determined by public and secret keys combination.
|
14
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
14
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/Project
|
15
15
|
# rubocop:disable Naming/AccessorMethodName
|
16
16
|
def get_project
|
17
17
|
Uploadcare::Project.show
|
@@ -10,7 +10,7 @@ module Uploadcare
|
|
10
10
|
class WebhookApi < Base
|
11
11
|
class << self
|
12
12
|
# Returns a list (not paginated) of webhooks
|
13
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
13
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhooksList
|
14
14
|
# rubocop:disable Naming/AccessorMethodName
|
15
15
|
def get_webhooks
|
16
16
|
Uploadcare::Webhook.list
|
@@ -18,20 +18,20 @@ module Uploadcare
|
|
18
18
|
# rubocop:enable Naming/AccessorMethodName
|
19
19
|
|
20
20
|
# Create a webhook
|
21
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
21
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhookCreate
|
22
22
|
def create_webhook(target_url, event: 'file.uploaded', is_active: true, signing_secret: nil)
|
23
23
|
options = { target_url: target_url, event: event, is_active: is_active, signing_secret: signing_secret }
|
24
24
|
Uploadcare::Webhook.create(**options.compact)
|
25
25
|
end
|
26
26
|
|
27
27
|
# Updates a webhook
|
28
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
29
|
-
def update_webhook(id,
|
30
|
-
Uploadcare::Webhook.update(id,
|
28
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/updateWebhook
|
29
|
+
def update_webhook(id, options = {})
|
30
|
+
Uploadcare::Webhook.update(id, options)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Permanently deletes a webhook
|
34
|
-
# @see https://uploadcare.com/api-refs/rest-api/v0.
|
34
|
+
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhookUnsubscribe
|
35
35
|
def delete_webhook(target_url)
|
36
36
|
Uploadcare::Webhook.delete(target_url)
|
37
37
|
end
|
@@ -15,7 +15,7 @@ module Uploadcare
|
|
15
15
|
#
|
16
16
|
# @see https://uploadcare.com/api-refs/upload-api/#operation/baseUpload
|
17
17
|
# @see https://uploadcare.com/api-refs/upload-api/#operation/multipartFileUploadStart
|
18
|
-
def upload_file(file,
|
18
|
+
def upload_file(file, options = {})
|
19
19
|
return upload(file, options) if file?(file) || file.is_a?(String)
|
20
20
|
|
21
21
|
raise TypeError, "The first argument must be a File or String (URL), #{file.class} given"
|
@@ -24,7 +24,7 @@ module Uploadcare
|
|
24
24
|
# Uploads several files smaller than 100MB.
|
25
25
|
#
|
26
26
|
# https://uploadcare.com/api-refs/upload-api/#operation/multipartFileUploadStart
|
27
|
-
def upload_files(files,
|
27
|
+
def upload_files(files, options = {})
|
28
28
|
return upload(files, options) if array_of_files?(files)
|
29
29
|
|
30
30
|
raise TypeError, 'The first argument must be an Array of File objects'
|
@@ -40,8 +40,8 @@ module Uploadcare
|
|
40
40
|
object.respond_to?(:path) && ::File.exist?(object.path)
|
41
41
|
end
|
42
42
|
|
43
|
-
def upload(files, options)
|
44
|
-
Uploadcare::Uploader.upload(files,
|
43
|
+
def upload(files, options = {})
|
44
|
+
Uploadcare::Uploader.upload(files, options)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -32,9 +32,7 @@ module Uploadcare
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def store
|
35
|
-
|
36
|
-
::Rails.cache.write(cache_key, group_info, expires_in: cache_expires_in) if caching_enabled?
|
37
|
-
update_attrs(group_info)
|
35
|
+
Uploadcare::GroupApi.store_group(id)
|
38
36
|
end
|
39
37
|
|
40
38
|
def to_s
|
@@ -10,7 +10,7 @@ module Uploadcare
|
|
10
10
|
def initialize(options = {})
|
11
11
|
raise ArgumentError, "Options argument must be a Hash, #{options.class} is given?" unless options.is_a?(Hash)
|
12
12
|
|
13
|
-
@options = options.
|
13
|
+
@options = options.to_h { |k, v| [k.to_sym, v] }
|
14
14
|
end
|
15
15
|
|
16
16
|
def call
|
data/lib/uploadcare-rails.rb
CHANGED
@@ -9,6 +9,8 @@ require 'uploadcare/rails/api/rest/group_api'
|
|
9
9
|
require 'uploadcare/rails/api/rest/project_api'
|
10
10
|
require 'uploadcare/rails/api/rest/webhook_api'
|
11
11
|
require 'uploadcare/rails/api/rest/conversion_api'
|
12
|
+
require 'uploadcare/rails/api/rest/file_metadata_api'
|
13
|
+
require 'uploadcare/rails/api/rest/addons_api'
|
12
14
|
require 'uploadcare/rails/api/upload/upload_api'
|
13
15
|
|
14
16
|
module Uploadcare
|