You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CDN URL support with custom domains and subdomains (#180)
* Add support for cdn_base,use_subdomains, and custom_cname
* Add missing
* Apply suggestion from @coderabbitai[bot]
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Lint
* fmt
* More rubocop fixes
* `#cdn_url` universalisation in README.md
* Version bump
* refactor: simplify CnameGenerator by using custom_cname directly
Replace generate_cname call with direct custom_cname usage in cdn_base_postfix
to reduce method indirection, addressing CodeRabbit review suggestion.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* fix: update CnameGenerator specs to match implementation
Update test mocks to use custom_cname instead of generate_cname
to align with the refactored implementation.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* style: fix RuboCop offenses - add empty lines after module inclusion
Add empty lines after module inclusion in 4 files to comply with
Layout/EmptyLinesAfterModuleInclusion RuboCop rule.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* chore: upgrade to Ruby 3.4 and update CI matrix
- Add Ruby 3.4 to GitHub Actions test matrix
- Update style check job to use Ruby 3.4
- Add .claude/ to .gitignore and remove from git history
- Fix CHANGELOG.md domain typo (ucarecdn.net -> ucarecd.net)
- Add Ruby 3.4 support note to CHANGELOG
- All tests pass with Ruby 3.4.5
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Alex Gusev <[email protected]>
Co-authored-by: Claude <[email protected]>
If you use `api_struct` gem in your project, replace it with `uploadcare-api_struct`:
77
+
76
78
```ruby
77
79
gem 'uploadcare-api_struct'
78
80
```
81
+
79
82
and run `bundle install`
80
83
81
84
If already not, create your project in [Uploadcare dashboard](https://app.uploadcare.com/?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-ruby) and copy
82
85
its [API keys](https://app.uploadcare.com/projects/-/api-keys/) from there.
83
86
84
87
Set your Uploadcare keys in config file or through environment variables:
88
+
85
89
```bash
86
90
export UPLOADCARE_PUBLIC_KEY=your_public_key
87
91
export UPLOADCARE_SECRET_KEY=your_private_key
@@ -109,6 +113,7 @@ You can also find an example project [here](https://github.com/uploadcare/upload
109
113
In examples we’re going to use `ucarecdn.com` domain. Check your project's subdomain in the [Dashboard](https://app.uploadcare.com/projects/-/settings/#delivery).
110
114
111
115
### Uploading files
116
+
112
117
#### Uploading and storing a single file
113
118
114
119
Using Uploadcare is simple, and here are the basics of handling files.
@@ -124,9 +129,18 @@ Using Uploadcare is simple, and here are the basics of handling files.
124
129
# URL for the file, can be used with your website or app right away
The `store` option can have these possible values:
143
+
130
144
-`true`: mark the uploaded file as stored.
131
145
-`false`: do not mark the uploaded file as stored and remove it after 24 hours.
132
146
-`"auto"`: defers the choice of storage behavior to the [auto-store setting](https://app.uploadcare.com/projects/-/settings/#storage) for your Uploadcare project. This is the default behavior.
This method accepts options to set properties of an output file:
669
704
670
705
-**uuid** — the file UUID-identifier.
@@ -702,7 +737,9 @@ This method accepts options to set properties of an output file:
702
737
:problems=>{}
703
738
}
704
739
```
740
+
705
741
Params in the response:
742
+
706
743
-**result** - info related to your transformed output(-s):
707
744
-**original_source** - built path for a particular video with all the conversion operations and parameters.
708
745
-**token** - a processing job token that can be used to get a [job status](https://uploadcare.com/docs/transformations/video-encoding/#status) (see below).
-**status** - processing job status, can have one of the following values:
747
-
-*pending* — video file is being prepared for conversion.
748
-
-*processing* — video file processing is in progress.
749
-
-*finished* — the processing is finished.
750
-
-*failed* — we failed to process the video, see error for details.
751
-
-*canceled* — video processing was canceled.
785
+
-_pending_ — video file is being prepared for conversion.
786
+
-_processing_ — video file processing is in progress.
787
+
-_finished_ — the processing is finished.
788
+
-_failed_ — we failed to process the video, see error for details.
789
+
-_canceled_ — video processing was canceled.
752
790
-**error** - holds a processing error if we failed to handle your video.
753
791
-**result** - repeats the contents of your processing output.
754
792
-**thumbnails_group_uuid** - holds :uuid-thumb-group, a UUID of a file group with thumbnails for an output video, based on the thumbs operation parameters.
@@ -761,6 +799,7 @@ More examples and options can be found [here](https://uploadcare.com/docs/transf
761
799
After each document file upload you obtain a file identifier in UUID format.
762
800
763
801
You can use file identifier to determine the document format and possible conversion formats.
or create an image of a particular page (if using image format):
830
+
790
831
```ruby
791
832
Uploadcare::DocumentConverter.convert(
792
833
[
@@ -819,7 +860,9 @@ This method accepts options to set properties of an output file:
819
860
:problems=>{}
820
861
}
821
862
```
863
+
822
864
Params in the response:
865
+
823
866
-**result** - info related to your transformed output(-s):
824
867
-**original_source** - source file identifier including a target format, if present.
825
868
-**token** - a processing job token that can be used to get a [job status](https://uploadcare.com/docs/transformations/document-conversion/#status) (see below).
@@ -843,6 +886,7 @@ To check a status of a document processing job you can simply use appropriate me
843
886
token =21120220
844
887
Uploadcare::DocumentConverter.status(token)
845
888
```
889
+
846
890
`token` here is a processing job token, obtained in a response of a convert document request.
0 commit comments