uploadcare-ruby 4.3.1 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +5 -1
- data/CHANGELOG.md +16 -0
- data/README.md +0 -1
- data/lib/uploadcare/client/uploader_client.rb +12 -0
- data/lib/uploadcare/entity/uploader.rb +13 -1
- data/lib/uploadcare/ruby/version.rb +1 -1
- data/uploadcare-ruby.gemspec +11 -7
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5c598d6772c849c127dd37c679264f9a4d898c53d3b2fa7272d3c43b7dc550
|
4
|
+
data.tar.gz: 9731b2e4576361e677549071cbc7c99cfb4f2203359a14554968a5acfcdba5b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e026bc3bda0b65d92b8315825b58bcabf596d8aab4a6ae7c0c75f24a4472c2bc088ab74befb426d702f4c48777b82aa5b885cce37acdc0db57aeb117084f541c
|
7
|
+
data.tar.gz: 61a4d2a80ca99fc6a7b70eee7d0bee7737e3f5c35a88a04d98a84ef0d6490e365c3cea2572e8773bcbb28915685b37a0a5e9a4bfd5a4c5f70a5055143ed1012e
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.3.3 — 2023-04-14
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
* Use `file_info` request after a file upload if the secret key is not provided.
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
* Add a new `file_info` method to retreive file information without the secret key.
|
12
|
+
|
13
|
+
## 4.3.2 — 2023-03-28
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
* Improved readme to look better at ruby-doc
|
18
|
+
|
3
19
|
## 4.3.1 — 2023-03-17
|
4
20
|
|
5
21
|
### Changed
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)
|
4
4
|
[![Build Status][actions-img]][actions-badge]
|
5
5
|
[![Uploadcare stack on StackShare][stack-img]][stack]
|
6
|
-
<!--[![Coverage Status][coverals-img]][coverals]-->
|
7
6
|
|
8
7
|
[actions-badge]: https://github.com/uploadcare/uploadcare-ruby/actions/workflows/ruby.yml
|
9
8
|
[actions-img]: https://github.com/uploadcare/uploadcare-ruby/actions/workflows/ruby.yml/badge.svg
|
@@ -53,6 +53,18 @@ module Uploadcare
|
|
53
53
|
get(path: 'from_url/status/', params: query_params)
|
54
54
|
end
|
55
55
|
|
56
|
+
# Get information about an uploaded file
|
57
|
+
# Secret key not needed
|
58
|
+
#
|
59
|
+
# https://uploadcare.com/api-refs/upload-api/#tag/Upload/operation/fileUploadInfo
|
60
|
+
def file_info(uuid)
|
61
|
+
query_params = {
|
62
|
+
file_id: uuid,
|
63
|
+
pub_key: Uploadcare.config.public_key
|
64
|
+
}
|
65
|
+
get(path: 'info/', params: query_params)
|
66
|
+
end
|
67
|
+
|
56
68
|
private
|
57
69
|
|
58
70
|
alias api_struct_post post
|
@@ -33,7 +33,13 @@ module Uploadcare
|
|
33
33
|
# upload single file
|
34
34
|
def self.upload_file(file, options = {})
|
35
35
|
response = UploaderClient.new.upload_many([file], options)
|
36
|
-
|
36
|
+
uuid = response.success.values.first
|
37
|
+
if Uploadcare.config.secret_key.nil?
|
38
|
+
Uploadcare::Entity::File.new(file_info(uuid).success)
|
39
|
+
else
|
40
|
+
# we can get more info about the uploaded file
|
41
|
+
Uploadcare::Entity::File.info(uuid)
|
42
|
+
end
|
37
43
|
end
|
38
44
|
|
39
45
|
# upload multiple files
|
@@ -63,6 +69,12 @@ module Uploadcare
|
|
63
69
|
UploaderClient.new.get_upload_from_url_status(token)
|
64
70
|
end
|
65
71
|
|
72
|
+
# Get information about an uploaded file (without the secret key)
|
73
|
+
# @param uuid [String]
|
74
|
+
def self.file_info(uuid)
|
75
|
+
UploaderClient.new.file_info(uuid)
|
76
|
+
end
|
77
|
+
|
66
78
|
class << self
|
67
79
|
private
|
68
80
|
|
data/uploadcare-ruby.gemspec
CHANGED
@@ -13,18 +13,22 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.summary = 'Ruby wrapper for uploadcare API'
|
14
14
|
spec.description = 'Ruby API client that handles uploads and further operations with files ' \
|
15
15
|
'by wrapping Uploadcare Upload and REST APIs.'
|
16
|
-
spec.homepage = 'https://
|
16
|
+
spec.homepage = 'https://uploadcare.com/'
|
17
17
|
spec.license = 'MIT'
|
18
|
+
spec.email = ['hello@uploadcare.com']
|
18
19
|
|
19
20
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
20
21
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
21
22
|
if spec.respond_to?(:metadata)
|
22
|
-
spec.metadata
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
spec.metadata = {
|
24
|
+
'allowed_push_host' => 'https://rubygems.org',
|
25
|
+
'homepage_uri' => spec.homepage,
|
26
|
+
'source_code_uri' => 'https://github.com/uploadcare/uploadcare-ruby',
|
27
|
+
'changelog_uri' => 'https://github.com/uploadcare/uploadcare-ruby/CHANGELOG.md',
|
28
|
+
'bug_tracker_uri' => 'https://github.com/uploadcare/uploadcare-ruby/issues',
|
29
|
+
'documentation_uri' => 'https://www.rubydoc.info/gems/uploadcare-ruby/',
|
30
|
+
'rubygems_mfa_required' => 'true'
|
31
|
+
}
|
28
32
|
else
|
29
33
|
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
30
34
|
'public gem pushes.'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uploadcare-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@dmitrijivanchenko (Dmitrij Ivanchenko), @T0mbery (Andrey Aksenov)"
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mimemagic
|
@@ -159,7 +159,8 @@ dependencies:
|
|
159
159
|
version: '3.18'
|
160
160
|
description: Ruby API client that handles uploads and further operations with files
|
161
161
|
by wrapping Uploadcare Upload and REST APIs.
|
162
|
-
email:
|
162
|
+
email:
|
163
|
+
- hello@uploadcare.com
|
163
164
|
executables: []
|
164
165
|
extensions: []
|
165
166
|
extra_rdoc_files: []
|
@@ -230,14 +231,16 @@ files:
|
|
230
231
|
- lib/uploadcare/signed_url_generators/amakai_generator.rb
|
231
232
|
- lib/uploadcare/signed_url_generators/base_generator.rb
|
232
233
|
- uploadcare-ruby.gemspec
|
233
|
-
homepage: https://
|
234
|
+
homepage: https://uploadcare.com/
|
234
235
|
licenses:
|
235
236
|
- MIT
|
236
237
|
metadata:
|
237
238
|
allowed_push_host: https://rubygems.org
|
238
|
-
homepage_uri: https://
|
239
|
+
homepage_uri: https://uploadcare.com/
|
239
240
|
source_code_uri: https://github.com/uploadcare/uploadcare-ruby
|
240
241
|
changelog_uri: https://github.com/uploadcare/uploadcare-ruby/CHANGELOG.md
|
242
|
+
bug_tracker_uri: https://github.com/uploadcare/uploadcare-ruby/issues
|
243
|
+
documentation_uri: https://www.rubydoc.info/gems/uploadcare-ruby/
|
241
244
|
rubygems_mfa_required: 'true'
|
242
245
|
post_install_message:
|
243
246
|
rdoc_options: []
|
@@ -256,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
259
|
- !ruby/object:Gem::Version
|
257
260
|
version: '0'
|
258
261
|
requirements: []
|
259
|
-
rubygems_version: 3.4.
|
262
|
+
rubygems_version: 3.4.10
|
260
263
|
signing_key:
|
261
264
|
specification_version: 4
|
262
265
|
summary: Ruby wrapper for uploadcare API
|