uploadcare-ruby 2.1.2 → 3.1.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.
- checksums.yaml +4 -4
- 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 +33 -0
- data/.yardopts +4 -0
- data/CHANGELOG.md +29 -47
- data/DEVELOPMENT.md +18 -0
- data/Gemfile +2 -0
- data/LICENSE +1 -1
- data/README.md +433 -527
- data/Rakefile +5 -5
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/uploadcare/api/api.rb +25 -0
- data/lib/uploadcare/client/conversion/base_conversion_client.rb +59 -0
- data/lib/uploadcare/client/conversion/document_conversion_client.rb +41 -0
- data/lib/uploadcare/client/conversion/video_conversion_client.rb +46 -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 +57 -0
- data/lib/uploadcare/client/multipart_upload_client.rb +64 -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 +43 -0
- data/lib/uploadcare/client/uploader_client.rb +101 -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/conversion/base_converter.rb +36 -0
- data/lib/uploadcare/entity/conversion/document_converter.rb +15 -0
- data/lib/uploadcare/entity/conversion/video_converter.rb +15 -0
- data/lib/uploadcare/entity/decorator/paginator.rb +79 -0
- data/lib/uploadcare/entity/entity.rb +18 -0
- data/lib/uploadcare/entity/file.rb +106 -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 +81 -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/lib/uploadcare.rb +36 -32
- data/uploadcare-ruby.gemspec +50 -37
- metadata +107 -113
- data/.travis.yml +0 -26
- data/UPGRADE_NOTES.md +0 -36
- 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/upload_params.rb +0 -72
- data/lib/uploadcare/api/uploading_api.rb +0 -71
- 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/api.rb +0 -26
- 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 -43
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08303dd0379957a7780c58d562c2ddbf9ae42e02d8069e19404defb9d7455292'
|
|
4
|
+
data.tar.gz: d661a6c49bdcb5b5789b3e22dac0a0a439012f0a1bfc5a55b3cdc0c64094ef8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4b2c4f5342f48908731446e7ca2fa5aabef6568d99dede4ca46f3ed3df13993a156f70f84ac6a87d36799b2d589bc465814c7efeefcbfd6a3e459d3e378814f
|
|
7
|
+
data.tar.gz: 0ffba57715c58eeeabc2d2b44884e67d09a5ee41b916fd10248e46822d5b35d3dd5c24c450ec4961a03b5a6f01903a5867007248bd347b88ac3568d89104c592
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish Gem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v1
|
|
13
|
+
|
|
14
|
+
- name: Release Gem
|
|
15
|
+
if: contains(github.ref, 'refs/tags/v')
|
|
16
|
+
uses: cadwallion/publish-rubygems-action@v1.0.0
|
|
17
|
+
env:
|
|
18
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
19
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
|
20
|
+
RELEASE_COMMAND: rake release
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
+
# They are provided by a third-party and are governed by
|
|
3
|
+
# separate terms of service, privacy policy, and support
|
|
4
|
+
# documentation.
|
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
+
|
|
8
|
+
name: Ruby
|
|
9
|
+
|
|
10
|
+
on: [push, pull_request]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
ruby-version: [
|
|
19
|
+
'2.4', '2.5', # eol
|
|
20
|
+
'2.6', '2.7', # maintained
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
- name: Set up Ruby
|
|
26
|
+
uses: ruby/setup-ruby@v1
|
|
27
|
+
with:
|
|
28
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
29
|
+
bundler-cache: true
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: bundle exec rake
|
|
32
|
+
env:
|
|
33
|
+
UPLOADCARE_PUBLIC_KEY: demopublickey
|
|
34
|
+
UPLOADCARE_SECRET_KEY: demoprivatekey
|
|
35
|
+
|
|
36
|
+
style-check:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
continue-on-error: true
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
ruby-version: ['2.7',]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v2
|
|
44
|
+
- name: Set up Ruby
|
|
45
|
+
uses: ruby/setup-ruby@v1
|
|
46
|
+
with:
|
|
47
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
48
|
+
bundler-cache: true
|
|
49
|
+
- name: Install Rubocop
|
|
50
|
+
run: gem install rubocop
|
|
51
|
+
- name: Check codestyle
|
|
52
|
+
run: rubocop
|
data/.gitignore
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/_yardoc/
|
|
4
|
+
/coverage/
|
|
5
|
+
/doc/
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/tmp/
|
|
9
|
+
/spec/fixtures/big.jpeg
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
# rspec failure tracking
|
|
12
|
+
.rspec_status
|
|
13
|
+
.byebug_history
|
|
14
|
+
Gemfile.lock
|
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: 2.7
|
|
3
|
+
|
|
4
|
+
Metrics/LineLength:
|
|
5
|
+
Max: 120
|
|
6
|
+
|
|
7
|
+
IneffectiveAccessModifier:
|
|
8
|
+
Enabled: false
|
|
9
|
+
|
|
10
|
+
Style/HashTransformKeys:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'lib/uploadcare/entity/decorator/paginator.rb'
|
|
13
|
+
- 'lib/uploadcare/client/conversion/video_conversion_client.rb'
|
|
14
|
+
- 'lib/uploadcare/entity/file.rb'
|
|
15
|
+
|
|
16
|
+
Gemspec/RequiredRubyVersion:
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'uploadcare-ruby.gemspec'
|
|
19
|
+
|
|
20
|
+
Metrics/BlockLength:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'bin/'
|
|
23
|
+
- 'spec/**/*'
|
|
24
|
+
- 'uploadcare-ruby.gemspec'
|
|
25
|
+
|
|
26
|
+
Metrics/MethodLength:
|
|
27
|
+
Max: 20
|
|
28
|
+
|
|
29
|
+
Style/Documentation:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
Style/OptionalBooleanParameter:
|
|
33
|
+
AllowedMethods: ['create']
|
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -1,65 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
3
|
+
## 3.1.0 2021-09-21
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
- Added documents and videos conversion
|
|
6
|
+
- Added new attributes to the Entity class (variations, video_info, source, rekognition_info)
|
|
7
|
+
- Added an opportunity to add custom logic to large files uploading process
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- Show Uploadcare::USER_AGENT deprecation warning only when the constant is being used
|
|
9
|
+
## 3.0.5 2021-04-15
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
- Replace Travis-CI with Github Actions
|
|
12
|
+
- Automate gem pushing
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- Allow user to override User-Agent header
|
|
16
|
-
- User-Agent format reports gem name, version and environment
|
|
14
|
+
## 3.0.4-dev 2020-03-19
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
- Added better pagination methods for GroupList & FileList
|
|
17
|
+
- Improved documentation and install instructions
|
|
18
|
+
- Added CI
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 3.0.3-dev 2020-03-13
|
|
21
|
+
- Added better pagination and iterators for GroupList & FileList
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
## 3.0.2-dev 2020-03-11
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
- Methods to store/delete multiple files at once: `Uploadcare::Api#store_files` & `Uploadcare::Api#delete_files`
|
|
25
|
+
- Expanded File and Group entities
|
|
26
|
+
- Changed user agent syntax
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
- Upgraded to REST API v0.5
|
|
30
|
-
- All POST/PUT/DELETE params are now being sent as JSON instead of being form-encoded
|
|
31
|
-
- Pagination implementation for files and groups
|
|
28
|
+
## 3.0.1-dev 2020-03-11
|
|
32
29
|
|
|
30
|
+
- Added Upload/group functionality
|
|
31
|
+
- Added user API
|
|
32
|
+
- Added user agent
|
|
33
|
+
- Isolated clients, entities and concerns
|
|
34
|
+
- Expanded documentation
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
## 3.0.0-dev 2020-02-18
|
|
35
37
|
|
|
36
38
|
### Changed
|
|
37
|
-
-
|
|
38
|
-
- User-Agent format reports gem name, version and environment
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## 1.1.0 - 2017-03-21
|
|
39
|
+
- Rewrote gem from scratch
|
|
42
40
|
|
|
43
41
|
### Added
|
|
44
|
-
- Added to new methods to `Uploadcare::Api::File`, `#internal_copy` and `#external_copy`.
|
|
45
|
-
- Added support of [secure authorization](https://uploadcare.com/documentation/rest/#request) for REST API. It is now used by default (can be overriden in config)
|
|
46
|
-
|
|
47
|
-
### Fixed
|
|
48
|
-
- Fixed middleware names that could break other gems ([#13](https://github.com/uploadcare/uploadcare-ruby/issues/13)).
|
|
49
|
-
|
|
50
|
-
### Deprecated
|
|
51
|
-
- `Uploadcare::Api::File#copy` in favor of `#internal_copy` and `#external_copy`.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## 1.0.6, 2017-01-30
|
|
55
|
-
|
|
56
|
-
### Added
|
|
57
|
-
- Ruby version and public API key sent via User-Agent header (can be overriden in config)
|
|
58
|
-
|
|
59
|
-
### Fixed
|
|
60
|
-
- Incorrect dependencies
|
|
61
|
-
|
|
62
42
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
- Client wrappers for REST API
|
|
44
|
+
- Serializers for REST API
|
|
45
|
+
- Client wrappers for Upload API
|
|
46
|
+
- Serializers for Upload API
|
|
47
|
+
- rdoc documentation
|
data/DEVELOPMENT.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## How to contribute
|
|
2
|
+
|
|
3
|
+
https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md
|
|
4
|
+
|
|
5
|
+
## Useful docs
|
|
6
|
+
|
|
7
|
+
### Uploadcare:
|
|
8
|
+
|
|
9
|
+
* https://uploadcare.com/docs/api_reference/
|
|
10
|
+
* https://uploadcare.com/api-refs/rest-api/
|
|
11
|
+
|
|
12
|
+
### ApiStruct:
|
|
13
|
+
|
|
14
|
+
* https://github.com/rubygarage/api_struct/
|
|
15
|
+
|
|
16
|
+
## Uploadcare-ruby gem architecture
|
|
17
|
+
|
|
18
|
+

|
data/Gemfile
CHANGED
data/LICENSE
CHANGED