uploadcare-ruby 2.1.1 → 3.1.0.pre.rc1
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.
- checksums.yaml +5 -5
- data/.github/workflows/gem-push.yml +20 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.gitignore +13 -6
- data/.rspec +2 -0
- data/.rubocop.yml +32 -0
- data/.yardopts +4 -0
- data/CHANGELOG.md +33 -34
- data/DEVELOPMENT.md +18 -0
- data/Gemfile +2 -0
- data/LICENSE +1 -1
- data/README.md +369 -546
- data/Rakefile +5 -5
- 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/conversion/base_conversion_client.rb +54 -0
- data/lib/uploadcare/client/conversion/document_conversion_client.rb +38 -0
- data/lib/uploadcare/client/conversion/video_conversion_client.rb +42 -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 +48 -0
- data/lib/uploadcare/client/multipart_upload_client.rb +67 -0
- data/lib/uploadcare/client/project_client.rb +18 -0
- data/lib/uploadcare/client/rest_client.rb +74 -0
- data/lib/uploadcare/client/rest_group_client.rb +23 -0
- data/lib/uploadcare/client/upload_client.rb +36 -0
- data/lib/uploadcare/client/uploader_client.rb +109 -0
- data/lib/uploadcare/client/webhook_client.rb +47 -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 +79 -0
- data/lib/uploadcare/entity/document_converter.rb +26 -0
- data/lib/uploadcare/entity/entity.rb +18 -0
- data/lib/uploadcare/entity/file.rb +81 -0
- data/lib/uploadcare/entity/file_list.rb +31 -0
- data/lib/uploadcare/entity/group.rb +40 -0
- data/lib/uploadcare/entity/group_list.rb +24 -0
- data/lib/uploadcare/entity/project.rb +13 -0
- data/lib/uploadcare/entity/uploader.rb +75 -0
- data/lib/uploadcare/entity/video_converter.rb +26 -0
- data/lib/uploadcare/entity/webhook.rb +14 -0
- data/lib/uploadcare/exception/conversion_error.rb +8 -0
- data/lib/uploadcare/exception/request_error.rb +9 -0
- data/lib/uploadcare/exception/throttle_error.rb +16 -0
- data/lib/uploadcare/param/authentication_header.rb +25 -0
- data/lib/uploadcare/param/conversion/document/processing_job_url_builder.rb +39 -0
- data/lib/uploadcare/param/conversion/video/processing_job_url_builder.rb +64 -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 -37
- metadata +109 -115
- data/.travis.yml +0 -26
- data/UPGRADE_NOTES.md +0 -36
- data/lib/uploadcare/api.rb +0 -26
- data/lib/uploadcare/api/file_api.rb +0 -7
- data/lib/uploadcare/api/file_list_api.rb +0 -19
- data/lib/uploadcare/api/file_storage_api.rb +0 -34
- data/lib/uploadcare/api/group_api.rb +0 -38
- data/lib/uploadcare/api/group_list_api.rb +0 -17
- data/lib/uploadcare/api/project_api.rb +0 -9
- data/lib/uploadcare/api/raw_api.rb +0 -38
- data/lib/uploadcare/api/uploading_api.rb +0 -71
- data/lib/uploadcare/api/uploading_api/upload_params.rb +0 -72
- data/lib/uploadcare/api/validators/file_list_options_validator.rb +0 -73
- data/lib/uploadcare/api/validators/group_list_options_validator.rb +0 -49
- data/lib/uploadcare/errors/errors.rb +0 -64
- data/lib/uploadcare/resources/file.rb +0 -164
- data/lib/uploadcare/resources/file_list.rb +0 -14
- data/lib/uploadcare/resources/group.rb +0 -115
- data/lib/uploadcare/resources/group_list.rb +0 -14
- data/lib/uploadcare/resources/project.rb +0 -13
- data/lib/uploadcare/resources/resource_list.rb +0 -83
- 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 -53
- data/lib/uploadcare/rest/connections/upload_connection.rb +0 -22
- 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/file_list_api_spec.rb +0 -95
- data/spec/api/file_storage_api_spec.rb +0 -88
- data/spec/api/group_list_api_spec.rb +0 -59
- data/spec/api/raw_api_spec.rb +0 -25
- data/spec/api/uploading_api/upload_params_spec.rb +0 -99
- data/spec/api/uploading_api_spec.rb +0 -59
- data/spec/resources/file_list_spec.rb +0 -25
- data/spec/resources/file_spec.rb +0 -223
- data/spec/resources/group_list_spec.rb +0 -25
- 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/shared/resource_list.rb +0 -188
- data/spec/spec_helper.rb +0 -54
- data/spec/uploadcare_spec.rb +0 -16
- data/spec/utils/parser_spec.rb +0 -85
- data/spec/utils/user_agent_spec.rb +0 -46
- data/spec/view.png +0 -0
- data/spec/view2.jpg +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
module Entity
|
|
5
|
+
# This serializer is responsible for webhook handling
|
|
6
|
+
#
|
|
7
|
+
# @see https://uploadcare.com/docs/api_reference/rest/webhooks/
|
|
8
|
+
class Webhook < Entity
|
|
9
|
+
client_service WebhookClient
|
|
10
|
+
|
|
11
|
+
attr_entity :id, :created, :updated, :event, :target_url, :project, :is_active
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
module Exception
|
|
5
|
+
# Exception for throttled requests
|
|
6
|
+
class ThrottleError < StandardError
|
|
7
|
+
attr_reader :timeout
|
|
8
|
+
|
|
9
|
+
# @param timeout [Float] Amount of seconds the request have been throttled for
|
|
10
|
+
def initialize(timeout = 10.0)
|
|
11
|
+
super
|
|
12
|
+
@timeout = timeout
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'digest/md5'
|
|
4
|
+
require 'param/secure_auth_header'
|
|
5
|
+
require 'param/simple_auth_header'
|
|
6
|
+
|
|
7
|
+
module Uploadcare
|
|
8
|
+
module Param
|
|
9
|
+
# This object returns headers needed for authentication
|
|
10
|
+
# This authentication method is more secure, but more tedious
|
|
11
|
+
class AuthenticationHeader
|
|
12
|
+
# @see https://uploadcare.com/docs/api_reference/rest/requests_auth/#auth-uploadcare
|
|
13
|
+
def self.call(**options)
|
|
14
|
+
case Uploadcare.config.auth_type
|
|
15
|
+
when 'Uploadcare'
|
|
16
|
+
SecureAuthHeader.call(**options)
|
|
17
|
+
when 'Uploadcare.Simple'
|
|
18
|
+
SimpleAuthHeader.call
|
|
19
|
+
else
|
|
20
|
+
raise ArgumentError, "Unknown auth_scheme: '#{Uploadcare.config.auth_type}'"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
module Param
|
|
5
|
+
module Conversion
|
|
6
|
+
module Document
|
|
7
|
+
class ProcessingJobUrlBuilder
|
|
8
|
+
class << self
|
|
9
|
+
def call(uuid:, format: nil, page: nil)
|
|
10
|
+
[
|
|
11
|
+
uuid_part(uuid),
|
|
12
|
+
format_part(format),
|
|
13
|
+
page_part(page)
|
|
14
|
+
].compact.join('-')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
def uuid_part(uuid)
|
|
20
|
+
"#{uuid}/document/"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def format_part(format)
|
|
24
|
+
return if format.nil?
|
|
25
|
+
|
|
26
|
+
"/format/#{format}/"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def page_part(page)
|
|
30
|
+
return if page.nil?
|
|
31
|
+
|
|
32
|
+
"/page/#{page}/"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
module Param
|
|
5
|
+
module Conversion
|
|
6
|
+
module Video
|
|
7
|
+
class ProcessingJobUrlBuilder
|
|
8
|
+
class << self
|
|
9
|
+
# rubocop:disable Metrics/ParameterLists
|
|
10
|
+
def call(uuid:, size: {}, quality: nil, format: nil, cut: {}, thumbs: {})
|
|
11
|
+
[
|
|
12
|
+
uuid_part(uuid),
|
|
13
|
+
size_part(size),
|
|
14
|
+
quality_part(quality),
|
|
15
|
+
format_part(format),
|
|
16
|
+
cut_part(cut),
|
|
17
|
+
thumbs_part(thumbs)
|
|
18
|
+
].compact.join('-')
|
|
19
|
+
end
|
|
20
|
+
# rubocop:enable Metrics/ParameterLists
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def uuid_part(uuid)
|
|
25
|
+
"#{uuid}/video/"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def size_part(size)
|
|
29
|
+
return if size.empty?
|
|
30
|
+
|
|
31
|
+
dimensions = "#{size[:width]}x#{size[:height]}" if size[:width] || size[:height]
|
|
32
|
+
resize_mode = (size[:resize_mode]).to_s
|
|
33
|
+
"/size/#{dimensions}/#{resize_mode}/".squeeze('/')
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def quality_part(quality)
|
|
37
|
+
return if quality.nil?
|
|
38
|
+
|
|
39
|
+
"/quality/#{quality}/"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def format_part(format)
|
|
43
|
+
return if format.nil?
|
|
44
|
+
|
|
45
|
+
"/format/#{format}/"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def cut_part(cut)
|
|
49
|
+
return if cut.empty?
|
|
50
|
+
|
|
51
|
+
"/cut/#{cut[:start_time]}/#{cut[:length]}/"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def thumbs_part(thumbs)
|
|
55
|
+
return if thumbs.empty?
|
|
56
|
+
|
|
57
|
+
"/thumbs~#{thumbs[:N]}/#{thumbs[:number]}/".squeeze('/')
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
# @abstract
|
|
5
|
+
# This module is responsible for everything related to generation of request params -
|
|
6
|
+
# such as authentication headers, signatures and serialized uploads
|
|
7
|
+
module Param
|
|
8
|
+
end
|
|
9
|
+
include Param
|
|
10
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'digest/md5'
|
|
4
|
+
|
|
5
|
+
module Uploadcare
|
|
6
|
+
module Param
|
|
7
|
+
# This object returns headers needed for authentication
|
|
8
|
+
# This authentication method is more secure, but more tedious
|
|
9
|
+
class SecureAuthHeader
|
|
10
|
+
# @see https://uploadcare.com/docs/api_reference/rest/requests_auth/#auth-uploadcare
|
|
11
|
+
def self.call(**options)
|
|
12
|
+
@method = options[:method]
|
|
13
|
+
@body = options[:content] || ''
|
|
14
|
+
@content_type = options[:content_type]
|
|
15
|
+
@uri = options[:uri]
|
|
16
|
+
@date_for_header = timestamp
|
|
17
|
+
{
|
|
18
|
+
'Date': @date_for_header,
|
|
19
|
+
'Authorization': "Uploadcare #{Uploadcare.config.public_key}:#{signature}"
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class << self
|
|
24
|
+
def signature
|
|
25
|
+
content_md5 = Digest::MD5.hexdigest(@body)
|
|
26
|
+
sign_string = [@method, content_md5, @content_type, @date_for_header, @uri].join("\n")
|
|
27
|
+
digest = OpenSSL::Digest.new('sha1')
|
|
28
|
+
OpenSSL::HMAC.hexdigest(digest, Uploadcare.config.secret_key, sign_string)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def timestamp
|
|
32
|
+
Time.now.gmtime.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Uploadcare
|
|
4
|
+
module Param
|
|
5
|
+
# This object returns simple header for authentication
|
|
6
|
+
# Simple header is relatively unsafe, but can be useful for debug and development
|
|
7
|
+
class SimpleAuthHeader
|
|
8
|
+
# @see https://uploadcare.com/docs/api_reference/rest/requests_auth/#auth-simple
|
|
9
|
+
def self.call
|
|
10
|
+
{ 'Authorization': "Uploadcare.Simple #{Uploadcare.config.public_key}:#{Uploadcare.config.secret_key}" }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'digest'
|
|
4
|
+
|
|
5
|
+
module Uploadcare
|
|
6
|
+
module Param
|
|
7
|
+
module Upload
|
|
8
|
+
# This class generates signatures for protected uploads
|
|
9
|
+
class SignatureGenerator
|
|
10
|
+
# @see https://uploadcare.com/docs/api_reference/upload/signed_uploads/
|
|
11
|
+
# @return [Hash] signature and its expiration time
|
|
12
|
+
def self.call
|
|
13
|
+
expires_at = Time.now.to_i + Uploadcare.config.upload_signature_lifetime
|
|
14
|
+
to_sign = Uploadcare.config.secret_key + expires_at.to_s
|
|
15
|
+
signature = Digest::MD5.hexdigest(to_sign)
|
|
16
|
+
{
|
|
17
|
+
'signature': signature,
|
|
18
|
+
'expire': expires_at
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'digest'
|
|
4
|
+
|
|
5
|
+
module Uploadcare
|
|
6
|
+
module Param
|
|
7
|
+
module Upload
|
|
8
|
+
# This class generates body params for uploads
|
|
9
|
+
class UploadParamsGenerator
|
|
10
|
+
# @see https://uploadcare.com/docs/api_reference/upload/request_based/
|
|
11
|
+
def self.call(store = 'auto')
|
|
12
|
+
store = '1' if store == true
|
|
13
|
+
store = '0' if store == false
|
|
14
|
+
{
|
|
15
|
+
'UPLOADCARE_PUB_KEY' => Uploadcare.config.public_key,
|
|
16
|
+
'UPLOADCARE_STORE' => store,
|
|
17
|
+
'signature' => (Upload::SignatureGenerator.call if Uploadcare.config.sign_uploads)
|
|
18
|
+
}.reject { |_k, v| v.nil? }
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'uploadcare'
|
|
4
|
+
|
|
5
|
+
module Uploadcare
|
|
6
|
+
module Param
|
|
7
|
+
# This header is added to track libraries using Uploadcare API
|
|
8
|
+
class UserAgent
|
|
9
|
+
# Generate header from Gem's config
|
|
10
|
+
#
|
|
11
|
+
# @example Uploadcare::Param::UserAgent.call
|
|
12
|
+
# UploadcareRuby/3.0.0-dev/Pubkey_(Ruby/2.6.3;UploadcareRuby)
|
|
13
|
+
def self.call
|
|
14
|
+
framework_data = Uploadcare.config.framework_data || ''
|
|
15
|
+
framework_data_string = "; #{Uploadcare.config.framework_data}" unless framework_data.empty?
|
|
16
|
+
public_key = Uploadcare.config.public_key
|
|
17
|
+
"UploadcareRuby/#{VERSION}/#{public_key} (Ruby/#{RUBY_VERSION}#{framework_data_string})"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/uploadcare-ruby.gemspec
CHANGED
|
@@ -1,38 +1,51 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
gem.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
gem.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require 'uploadcare/ruby/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = 'uploadcare-ruby'
|
|
9
|
+
spec.version = Uploadcare::VERSION
|
|
10
|
+
spec.authors = ['Stepan Redka, Dmitrij Ivanchenko']
|
|
11
|
+
spec.email = ['stepan.redka@railsmuffin.com', 'dmitrij.ivanchenko@gmail.com']
|
|
12
|
+
|
|
13
|
+
spec.summary = 'Ruby wrapper for uploadcare API'
|
|
14
|
+
spec.description = spec.summary
|
|
15
|
+
spec.homepage = 'https://github.com/uploadcare/uploadcare-ruby'
|
|
16
|
+
spec.license = 'MIT'
|
|
17
|
+
|
|
18
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
19
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
20
|
+
if spec.respond_to?(:metadata)
|
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
22
|
+
|
|
23
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
24
|
+
spec.metadata['source_code_uri'] = 'https://github.com/uploadcare/uploadcare-ruby'
|
|
25
|
+
spec.metadata['changelog_uri'] = 'https://github.com/uploadcare/uploadcare-ruby/CHANGELOG.md'
|
|
26
|
+
else
|
|
27
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
28
|
+
'public gem pushes.'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Specify which files should be added to the gem when it is released.
|
|
32
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
33
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
34
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
35
|
+
end
|
|
36
|
+
spec.bindir = 'exe'
|
|
37
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
38
|
+
spec.require_paths = ['lib', 'lib/uploadcare', 'lib/uploadcare/rest']
|
|
39
|
+
|
|
40
|
+
spec.add_dependency 'api_struct', '~> 1.0.1'
|
|
41
|
+
spec.add_dependency 'dry-configurable', '~> 0.9.0'
|
|
42
|
+
spec.add_dependency 'parallel'
|
|
43
|
+
spec.add_dependency 'retries'
|
|
44
|
+
|
|
45
|
+
spec.add_development_dependency 'byebug'
|
|
46
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
47
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
48
|
+
spec.add_development_dependency 'rubocop'
|
|
49
|
+
spec.add_development_dependency 'vcr'
|
|
50
|
+
spec.add_development_dependency 'webmock'
|
|
38
51
|
end
|
metadata
CHANGED
|
@@ -1,48 +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.1.0.pre.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
- "@dimituri (Dimitry Solovyov)"
|
|
9
|
-
- "@romanonthego (Roman Dubinin)"
|
|
10
|
-
- "@vizvamitra (Dmitrii Krasnov)"
|
|
7
|
+
- Stepan Redka, Dmitrij Ivanchenko
|
|
11
8
|
autorequire:
|
|
12
|
-
bindir:
|
|
9
|
+
bindir: exe
|
|
13
10
|
cert_chain: []
|
|
14
|
-
date:
|
|
11
|
+
date: 2021-08-11 00:00:00.000000000 Z
|
|
15
12
|
dependencies:
|
|
16
13
|
- !ruby/object:Gem::Dependency
|
|
17
|
-
name:
|
|
14
|
+
name: api_struct
|
|
18
15
|
requirement: !ruby/object:Gem::Requirement
|
|
19
16
|
requirements:
|
|
20
17
|
- - "~>"
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
19
|
+
version: 1.0.1
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
24
|
- - "~>"
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
26
|
+
version: 1.0.1
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
|
-
name:
|
|
28
|
+
name: dry-configurable
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
30
|
requirements:
|
|
34
31
|
- - "~>"
|
|
35
32
|
- !ruby/object:Gem::Version
|
|
36
|
-
version:
|
|
33
|
+
version: 0.9.0
|
|
37
34
|
type: :runtime
|
|
38
35
|
prerelease: false
|
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
37
|
requirements:
|
|
41
38
|
- - "~>"
|
|
42
39
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
40
|
+
version: 0.9.0
|
|
44
41
|
- !ruby/object:Gem::Dependency
|
|
45
|
-
name:
|
|
42
|
+
name: parallel
|
|
46
43
|
requirement: !ruby/object:Gem::Requirement
|
|
47
44
|
requirements:
|
|
48
45
|
- - ">="
|
|
@@ -56,7 +53,7 @@ dependencies:
|
|
|
56
53
|
- !ruby/object:Gem::Version
|
|
57
54
|
version: '0'
|
|
58
55
|
- !ruby/object:Gem::Dependency
|
|
59
|
-
name:
|
|
56
|
+
name: retries
|
|
60
57
|
requirement: !ruby/object:Gem::Requirement
|
|
61
58
|
requirements:
|
|
62
59
|
- - ">="
|
|
@@ -69,22 +66,50 @@ dependencies:
|
|
|
69
66
|
- - ">="
|
|
70
67
|
- !ruby/object:Gem::Version
|
|
71
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'
|
|
72
97
|
- !ruby/object:Gem::Dependency
|
|
73
98
|
name: rspec
|
|
74
99
|
requirement: !ruby/object:Gem::Requirement
|
|
75
100
|
requirements:
|
|
76
101
|
- - "~>"
|
|
77
102
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: '3.
|
|
103
|
+
version: '3.0'
|
|
79
104
|
type: :development
|
|
80
105
|
prerelease: false
|
|
81
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
82
107
|
requirements:
|
|
83
108
|
- - "~>"
|
|
84
109
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: '3.
|
|
110
|
+
version: '3.0'
|
|
86
111
|
- !ruby/object:Gem::Dependency
|
|
87
|
-
name:
|
|
112
|
+
name: rubocop
|
|
88
113
|
requirement: !ruby/object:Gem::Requirement
|
|
89
114
|
requirements:
|
|
90
115
|
- - ">="
|
|
@@ -98,7 +123,7 @@ dependencies:
|
|
|
98
123
|
- !ruby/object:Gem::Version
|
|
99
124
|
version: '0'
|
|
100
125
|
- !ruby/object:Gem::Dependency
|
|
101
|
-
name:
|
|
126
|
+
name: vcr
|
|
102
127
|
requirement: !ruby/object:Gem::Requirement
|
|
103
128
|
requirements:
|
|
104
129
|
- - ">="
|
|
@@ -112,7 +137,7 @@ dependencies:
|
|
|
112
137
|
- !ruby/object:Gem::Version
|
|
113
138
|
version: '0'
|
|
114
139
|
- !ruby/object:Gem::Dependency
|
|
115
|
-
name:
|
|
140
|
+
name: webmock
|
|
116
141
|
requirement: !ruby/object:Gem::Requirement
|
|
117
142
|
requirements:
|
|
118
143
|
- - ">="
|
|
@@ -125,92 +150,86 @@ dependencies:
|
|
|
125
150
|
- - ">="
|
|
126
151
|
- !ruby/object:Gem::Version
|
|
127
152
|
version: '0'
|
|
128
|
-
description:
|
|
129
|
-
Ruby wrapper for Uploadcare service API.
|
|
130
|
-
Full documentations on APIs can be found
|
|
131
|
-
at https://uploadcare.com/documentation/rest/
|
|
132
|
-
and https://uploadcare.com/documentation/upload/
|
|
153
|
+
description: Ruby wrapper for uploadcare API
|
|
133
154
|
email:
|
|
134
|
-
-
|
|
155
|
+
- stepan.redka@railsmuffin.com
|
|
156
|
+
- dmitrij.ivanchenko@gmail.com
|
|
135
157
|
executables: []
|
|
136
158
|
extensions: []
|
|
137
159
|
extra_rdoc_files: []
|
|
138
160
|
files:
|
|
161
|
+
- ".github/workflows/gem-push.yml"
|
|
162
|
+
- ".github/workflows/ruby.yml"
|
|
139
163
|
- ".gitignore"
|
|
140
164
|
- ".rspec"
|
|
141
|
-
- ".
|
|
165
|
+
- ".rubocop.yml"
|
|
166
|
+
- ".yardopts"
|
|
142
167
|
- CHANGELOG.md
|
|
168
|
+
- DEVELOPMENT.md
|
|
143
169
|
- Gemfile
|
|
144
170
|
- LICENSE
|
|
145
171
|
- README.md
|
|
146
172
|
- Rakefile
|
|
147
|
-
-
|
|
173
|
+
- bin/console
|
|
174
|
+
- bin/setup
|
|
148
175
|
- lib/uploadcare.rb
|
|
149
|
-
- lib/uploadcare/api.rb
|
|
150
|
-
- lib/uploadcare/
|
|
151
|
-
- lib/uploadcare/
|
|
152
|
-
- lib/uploadcare/
|
|
153
|
-
- lib/uploadcare/
|
|
154
|
-
- lib/uploadcare/
|
|
155
|
-
- lib/uploadcare/
|
|
156
|
-
- lib/uploadcare/
|
|
157
|
-
- lib/uploadcare/
|
|
158
|
-
- lib/uploadcare/
|
|
159
|
-
- lib/uploadcare/
|
|
160
|
-
- lib/uploadcare/
|
|
161
|
-
- lib/uploadcare/
|
|
162
|
-
- lib/uploadcare/
|
|
163
|
-
- lib/uploadcare/
|
|
164
|
-
- lib/uploadcare/
|
|
165
|
-
- lib/uploadcare/
|
|
166
|
-
- lib/uploadcare/
|
|
167
|
-
- lib/uploadcare/
|
|
168
|
-
- lib/uploadcare/
|
|
169
|
-
- lib/uploadcare/
|
|
170
|
-
- lib/uploadcare/
|
|
171
|
-
- lib/uploadcare/
|
|
172
|
-
- lib/uploadcare/
|
|
173
|
-
- lib/uploadcare/
|
|
174
|
-
- lib/uploadcare/
|
|
175
|
-
- lib/uploadcare/
|
|
176
|
-
- lib/uploadcare/
|
|
177
|
-
- lib/uploadcare/
|
|
178
|
-
- lib/uploadcare/
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
- spec/rest/api_connection_spec.rb
|
|
192
|
-
- spec/rest/auth/secure_spec.rb
|
|
193
|
-
- spec/rest/auth/simple_spec.rb
|
|
194
|
-
- spec/rest/errors_spec.rb
|
|
195
|
-
- spec/rest/upload_connection_spec.rb
|
|
196
|
-
- spec/shared/resource_list.rb
|
|
197
|
-
- spec/spec_helper.rb
|
|
198
|
-
- spec/uploadcare_spec.rb
|
|
199
|
-
- spec/utils/parser_spec.rb
|
|
200
|
-
- spec/utils/user_agent_spec.rb
|
|
201
|
-
- spec/view.png
|
|
202
|
-
- spec/view2.jpg
|
|
176
|
+
- lib/uploadcare/api/api.rb
|
|
177
|
+
- lib/uploadcare/client/conversion/base_conversion_client.rb
|
|
178
|
+
- lib/uploadcare/client/conversion/document_conversion_client.rb
|
|
179
|
+
- lib/uploadcare/client/conversion/video_conversion_client.rb
|
|
180
|
+
- lib/uploadcare/client/file_client.rb
|
|
181
|
+
- lib/uploadcare/client/file_list_client.rb
|
|
182
|
+
- lib/uploadcare/client/group_client.rb
|
|
183
|
+
- lib/uploadcare/client/multipart_upload/chunks_client.rb
|
|
184
|
+
- lib/uploadcare/client/multipart_upload_client.rb
|
|
185
|
+
- lib/uploadcare/client/project_client.rb
|
|
186
|
+
- lib/uploadcare/client/rest_client.rb
|
|
187
|
+
- lib/uploadcare/client/rest_group_client.rb
|
|
188
|
+
- lib/uploadcare/client/upload_client.rb
|
|
189
|
+
- lib/uploadcare/client/uploader_client.rb
|
|
190
|
+
- lib/uploadcare/client/webhook_client.rb
|
|
191
|
+
- lib/uploadcare/concern/error_handler.rb
|
|
192
|
+
- lib/uploadcare/concern/throttle_handler.rb
|
|
193
|
+
- lib/uploadcare/concern/upload_error_handler.rb
|
|
194
|
+
- lib/uploadcare/entity/decorator/paginator.rb
|
|
195
|
+
- lib/uploadcare/entity/document_converter.rb
|
|
196
|
+
- lib/uploadcare/entity/entity.rb
|
|
197
|
+
- lib/uploadcare/entity/file.rb
|
|
198
|
+
- lib/uploadcare/entity/file_list.rb
|
|
199
|
+
- lib/uploadcare/entity/group.rb
|
|
200
|
+
- lib/uploadcare/entity/group_list.rb
|
|
201
|
+
- lib/uploadcare/entity/project.rb
|
|
202
|
+
- lib/uploadcare/entity/uploader.rb
|
|
203
|
+
- lib/uploadcare/entity/video_converter.rb
|
|
204
|
+
- lib/uploadcare/entity/webhook.rb
|
|
205
|
+
- lib/uploadcare/exception/conversion_error.rb
|
|
206
|
+
- lib/uploadcare/exception/request_error.rb
|
|
207
|
+
- lib/uploadcare/exception/throttle_error.rb
|
|
208
|
+
- lib/uploadcare/param/authentication_header.rb
|
|
209
|
+
- lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
|
|
210
|
+
- lib/uploadcare/param/conversion/video/processing_job_url_builder.rb
|
|
211
|
+
- lib/uploadcare/param/param.rb
|
|
212
|
+
- lib/uploadcare/param/secure_auth_header.rb
|
|
213
|
+
- lib/uploadcare/param/simple_auth_header.rb
|
|
214
|
+
- lib/uploadcare/param/upload/signature_generator.rb
|
|
215
|
+
- lib/uploadcare/param/upload/upload_params_generator.rb
|
|
216
|
+
- lib/uploadcare/param/user_agent.rb
|
|
217
|
+
- lib/uploadcare/ruby/version.rb
|
|
203
218
|
- uploadcare-ruby.gemspec
|
|
204
|
-
homepage: https://
|
|
219
|
+
homepage: https://github.com/uploadcare/uploadcare-ruby
|
|
205
220
|
licenses:
|
|
206
221
|
- MIT
|
|
207
222
|
metadata:
|
|
208
|
-
|
|
209
|
-
|
|
223
|
+
allowed_push_host: https://rubygems.org
|
|
224
|
+
homepage_uri: https://github.com/uploadcare/uploadcare-ruby
|
|
225
|
+
source_code_uri: https://github.com/uploadcare/uploadcare-ruby
|
|
226
|
+
changelog_uri: https://github.com/uploadcare/uploadcare-ruby/CHANGELOG.md
|
|
210
227
|
post_install_message:
|
|
211
228
|
rdoc_options: []
|
|
212
229
|
require_paths:
|
|
213
230
|
- lib
|
|
231
|
+
- lib/uploadcare
|
|
232
|
+
- lib/uploadcare/rest
|
|
214
233
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
234
|
requirements:
|
|
216
235
|
- - ">="
|
|
@@ -218,37 +237,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
218
237
|
version: '0'
|
|
219
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
239
|
requirements:
|
|
221
|
-
- - "
|
|
240
|
+
- - ">"
|
|
222
241
|
- !ruby/object:Gem::Version
|
|
223
|
-
version:
|
|
242
|
+
version: 1.3.1
|
|
224
243
|
requirements: []
|
|
225
|
-
|
|
226
|
-
rubygems_version: 2.5.2
|
|
244
|
+
rubygems_version: 3.2.22
|
|
227
245
|
signing_key:
|
|
228
246
|
specification_version: 4
|
|
229
|
-
summary: Ruby
|
|
230
|
-
test_files:
|
|
231
|
-
- spec/api/file_list_api_spec.rb
|
|
232
|
-
- spec/api/file_storage_api_spec.rb
|
|
233
|
-
- spec/api/group_list_api_spec.rb
|
|
234
|
-
- spec/api/raw_api_spec.rb
|
|
235
|
-
- spec/api/uploading_api/upload_params_spec.rb
|
|
236
|
-
- spec/api/uploading_api_spec.rb
|
|
237
|
-
- spec/resources/file_list_spec.rb
|
|
238
|
-
- spec/resources/file_spec.rb
|
|
239
|
-
- spec/resources/group_list_spec.rb
|
|
240
|
-
- spec/resources/group_spec.rb
|
|
241
|
-
- spec/resources/operations_spec.rb
|
|
242
|
-
- spec/resources/project_spec.rb
|
|
243
|
-
- spec/rest/api_connection_spec.rb
|
|
244
|
-
- spec/rest/auth/secure_spec.rb
|
|
245
|
-
- spec/rest/auth/simple_spec.rb
|
|
246
|
-
- spec/rest/errors_spec.rb
|
|
247
|
-
- spec/rest/upload_connection_spec.rb
|
|
248
|
-
- spec/shared/resource_list.rb
|
|
249
|
-
- spec/spec_helper.rb
|
|
250
|
-
- spec/uploadcare_spec.rb
|
|
251
|
-
- spec/utils/parser_spec.rb
|
|
252
|
-
- spec/utils/user_agent_spec.rb
|
|
253
|
-
- spec/view.png
|
|
254
|
-
- spec/view2.jpg
|
|
247
|
+
summary: Ruby wrapper for uploadcare API
|
|
248
|
+
test_files: []
|