cloudinary 1.20.0 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +15 -14
- data/.github/ISSUE_TEMPLATE/feature_request.md +1 -1
- data/.github/pull_request_template.md +18 -11
- data/.travis.yml +12 -2
- data/CHANGELOG.md +68 -0
- data/README.md +87 -237
- data/cloudinary.gemspec +10 -1
- data/lib/cloudinary/account_api.rb +9 -13
- data/lib/cloudinary/api.rb +774 -124
- data/lib/cloudinary/auth_token.rb +7 -2
- data/lib/cloudinary/base_api.rb +24 -5
- data/lib/cloudinary/carrier_wave/process.rb +9 -1
- data/lib/cloudinary/search.rb +40 -7
- data/lib/cloudinary/uploader.rb +62 -25
- data/lib/cloudinary/utils.rb +155 -20
- data/lib/cloudinary/version.rb +1 -1
- data/lib/cloudinary.rb +21 -1
- data/vendor/assets/javascripts/cloudinary/jquery.cloudinary.js +20 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb49ce85c34e632ed20f09a8600694177bf8f82c8490ff5463554c0ab4b3b2e
|
4
|
+
data.tar.gz: cf2558234f2c9c5dac2de81d2ef2060432a36297a50728f9f01df8997de2805d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33147b3fb85715a5472259c06d636a29b45df54eee79d56677b2d2eca846b999e8452e4f6f0661bc9c198ad776d0313f64fb8444075c46fbec789463a2107c22
|
7
|
+
data.tar.gz: fc33de4ab89ec6bc63be65bad25fcbd0344975e8344ef29ecb365f9dd93c9bf7d6e611f96f8f60cd3d08cc222d308e6b04c27b835d4d9672b1c529821337dee2
|
@@ -3,7 +3,7 @@ name: Bug report
|
|
3
3
|
about: Bug report for Cloudinary Ruby SDK
|
4
4
|
title: ''
|
5
5
|
labels: ''
|
6
|
-
assignees:
|
6
|
+
assignees: ''
|
7
7
|
|
8
8
|
---
|
9
9
|
|
@@ -14,11 +14,11 @@ Before proceeding, please update to latest version and test if the issue persist
|
|
14
14
|
…
|
15
15
|
|
16
16
|
## Issue Type (Can be multiple)
|
17
|
-
[ ] Build -
|
18
|
-
[ ] Performance - Performance issues
|
19
|
-
[ ] Behaviour - Functions
|
20
|
-
[ ] Documentation - Inconsistency between the docs and behaviour
|
21
|
-
[ ] Other (Specify)
|
17
|
+
- [ ] Build - Cannot install or import the SDK
|
18
|
+
- [ ] Performance - Performance issues
|
19
|
+
- [ ] Behaviour - Functions are not working as expected (such as generate URL)
|
20
|
+
- [ ] Documentation - Inconsistency between the docs and behaviour
|
21
|
+
- [ ] Other (Specify)
|
22
22
|
|
23
23
|
## Steps to reproduce
|
24
24
|
… if applicable
|
@@ -27,16 +27,17 @@ Before proceeding, please update to latest version and test if the issue persist
|
|
27
27
|
…
|
28
28
|
|
29
29
|
## Operating System
|
30
|
-
[ ] Linux
|
31
|
-
[ ] Windows
|
32
|
-
[ ]
|
33
|
-
[ ] All
|
30
|
+
- [ ] Linux
|
31
|
+
- [ ] Windows
|
32
|
+
- [ ] macOS
|
33
|
+
- [ ] All
|
34
34
|
|
35
35
|
## Environment and Libraries (fill in the version numbers)
|
36
|
-
Cloudinary Ruby SDK version - 0.0.0
|
37
|
-
Ruby Version - 0.0.0
|
38
|
-
Rails Version - 0.0.0
|
39
|
-
Other Libraries (Carrierwave, ActiveStorage, etc) - 0.0.0
|
36
|
+
- Cloudinary Ruby SDK version - 0.0.0
|
37
|
+
- Ruby Version - 0.0.0
|
38
|
+
- Rails Version - 0.0.0
|
39
|
+
- Other Libraries (Carrierwave, ActiveStorage, etc) - 0.0.0
|
40
40
|
|
41
41
|
## Repository
|
42
|
+
|
42
43
|
If possible, please provide a link to a reproducible repository that showcases the problem
|
@@ -4,21 +4,28 @@ Provide some context as to what was changed, from an implementation standpoint.
|
|
4
4
|
-->
|
5
5
|
|
6
6
|
#### What does this PR address?
|
7
|
-
[ ]
|
8
|
-
[ ] Refactoring
|
9
|
-
[ ] New feature
|
10
|
-
[ ] Bug fix
|
11
|
-
[ ] Adds more tests
|
7
|
+
- [ ] GitHub issue (Add reference - #XX)
|
8
|
+
- [ ] Refactoring
|
9
|
+
- [ ] New feature
|
10
|
+
- [ ] Bug fix
|
11
|
+
- [ ] Adds more tests
|
12
12
|
|
13
13
|
#### Are tests included?
|
14
|
-
[ ] Yes
|
15
|
-
[ ] No
|
14
|
+
- [ ] Yes
|
15
|
+
- [ ] No
|
16
16
|
|
17
|
-
#### Reviewer,
|
17
|
+
#### Reviewer, please note:
|
18
18
|
<!--
|
19
19
|
List anything here that the reviewer should pay special attention to. This might
|
20
20
|
include, for example:
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
* Dependence on other PRs
|
22
|
+
* Reference to other Cloudinary SDKs
|
23
|
+
* Changes that seem arbitrary without further explanations
|
24
24
|
-->
|
25
|
+
|
26
|
+
#### Checklist:
|
27
|
+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
28
|
+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
29
|
+
- [ ] My code follows the code style of this project.
|
30
|
+
- [ ] My change requires a change to the documentation.
|
31
|
+
- [ ] I ran the full test suite before pushing the changes and all the tests pass.
|
data/.travis.yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
+
dist: focal
|
1
2
|
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 2.6.7
|
5
|
+
- 2.7.4
|
6
|
+
- 3.0.2
|
2
7
|
|
3
8
|
matrix:
|
4
9
|
include:
|
@@ -7,9 +12,9 @@ matrix:
|
|
7
12
|
rvm: 1.9.3
|
8
13
|
before_install:
|
9
14
|
- gem install bundler -v 1.17.3
|
10
|
-
- name: "Ruby 2.5.
|
15
|
+
- name: "Ruby 2.5.9"
|
11
16
|
dist: xenial
|
12
|
-
rvm: ruby-2.5.
|
17
|
+
rvm: ruby-2.5.9
|
13
18
|
before_install:
|
14
19
|
- gem install bundler
|
15
20
|
|
@@ -17,3 +22,8 @@ before_script: >
|
|
17
22
|
export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh);
|
18
23
|
echo cloud_name: "$(echo $CLOUDINARY_URL | cut -d'@' -f2)"
|
19
24
|
script: bundle exec rspec
|
25
|
+
|
26
|
+
notifications:
|
27
|
+
email:
|
28
|
+
recipients:
|
29
|
+
- sdk_developers@cloudinary.com
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,71 @@
|
|
1
|
+
1.23.0 / 2022-04-05
|
2
|
+
==================
|
3
|
+
|
4
|
+
New functionality and features
|
5
|
+
------------------------------
|
6
|
+
|
7
|
+
* Add support for multiple ACLs in `AuthToken`
|
8
|
+
* Add support for disable b-frames for video codec
|
9
|
+
* Add support for aliases in Configuration
|
10
|
+
* Add support for `filename` upload parameter
|
11
|
+
|
12
|
+
Other Changes
|
13
|
+
-------------
|
14
|
+
|
15
|
+
* Fix escaping of special characters in `public_id`
|
16
|
+
* Fix support of the lowercase response headers
|
17
|
+
* Fix CarrierWave file retrieval after store
|
18
|
+
|
19
|
+
1.22.0 / 2022-02-17
|
20
|
+
==================
|
21
|
+
|
22
|
+
New functionality and features
|
23
|
+
------------------------------
|
24
|
+
|
25
|
+
* Add support for OAuth authentication
|
26
|
+
* Add support for Dynamic Folder upload parameters
|
27
|
+
* Add support for `reorder_metadata_fields` Admin API
|
28
|
+
* Add support for `resources_by_asset_ids` Admin API
|
29
|
+
* Add support for `resource_by_asset_id` Admin API
|
30
|
+
* Add support for fetch url in overlay
|
31
|
+
* Add support for Ruby 3.0
|
32
|
+
* Add missing docstrings for Admin API methods
|
33
|
+
|
34
|
+
Other Changes
|
35
|
+
-------------
|
36
|
+
|
37
|
+
* Ignore `URL` in `AuthToken` generation when `ACL` is provided
|
38
|
+
* Update `README`
|
39
|
+
* Add tests for expression normalization
|
40
|
+
* Update Travis with current Ruby versions
|
41
|
+
|
42
|
+
1.21.0 / 2021-08-23
|
43
|
+
==================
|
44
|
+
|
45
|
+
New functionality and features
|
46
|
+
------------------------------
|
47
|
+
|
48
|
+
* Add support for `create_slideshow` Upload API
|
49
|
+
* Add support for variables in text style
|
50
|
+
* Add support for `context` and `metadata` in `rename` Upload API
|
51
|
+
* Add support for `reorder_metadata_field_datasource` Admin API
|
52
|
+
* Add `verify_api_response_signature` and `verify_notification_signature` helpers
|
53
|
+
* Add `download_generated_sprite` and `download_multi` methods
|
54
|
+
* Add support for `urls` in multi and sprite APIs
|
55
|
+
* Add support for `live` parameter in upload presets
|
56
|
+
* Add support for `metadata` parameter in `resources` Admin APIs
|
57
|
+
|
58
|
+
Other Changes
|
59
|
+
-------------
|
60
|
+
|
61
|
+
* Fix `transformations` API call
|
62
|
+
* Fix named parameters normalization issue
|
63
|
+
* Remove duplicates in Search Api fields
|
64
|
+
* Improve configuration tests
|
65
|
+
* Add tests for Provisioning API
|
66
|
+
* Refactor metadata usage in tests
|
67
|
+
* Update GitHub templates
|
68
|
+
|
1
69
|
1.20.0 / 2021-03-26
|
2
70
|
==================
|
3
71
|
|
data/README.md
CHANGED
@@ -1,277 +1,127 @@
|
|
1
|
-
[![Build Status](https://travis-ci.
|
2
|
-
|
3
|
-
|
1
|
+
[![Build Status](https://app.travis-ci.com/cloudinary/cloudinary_gem.svg?branch=master)](https://app.travis-ci.com/github/cloudinary/cloudinary_gem)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/cloudinary.svg)](https://rubygems.org/gems/cloudinary)
|
3
|
+
[![Gem Version](https://badgen.net/rubygems/dt/cloudinary)](https://rubygems.org/gems/cloudinary)
|
4
4
|
|
5
|
-
Cloudinary
|
5
|
+
Cloudinary Ruby on Rails SDK
|
6
|
+
===================
|
6
7
|
|
7
|
-
|
8
|
+
## About
|
8
9
|
|
9
|
-
Cloudinary
|
10
|
+
The Cloudinary Ruby on Rails SDK allows you to quickly and easily integrate your application with Cloudinary.
|
11
|
+
Effortlessly optimize, transform, upload and manage your cloud's assets.
|
10
12
|
|
11
|
-
|
13
|
+
#### Note
|
12
14
|
|
13
|
-
|
15
|
+
This Readme provides basic installation and usage information. For the complete documentation, see
|
16
|
+
the [Ruby on Rails SDK Guide](https://cloudinary.com/documentation/rails_integration).
|
14
17
|
|
15
|
-
##
|
16
|
-
![More](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **Take a look at our [Getting started guide of Ruby on Rails](https://cloudinary.com/documentation/rails_integration#getting_started_guide)**.
|
18
|
+
## Table of Contents
|
17
19
|
|
18
|
-
|
20
|
+
- [Key Features](#key-features)
|
21
|
+
- [Version Support](#Version-Support)
|
22
|
+
- [Installation](#installation)
|
23
|
+
- [Usage](#usage)
|
24
|
+
- [Setup](#Setup)
|
25
|
+
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)
|
26
|
+
- [CarrierWave Integration](#CarrierWave-Integration)
|
27
|
+
- [Active Storage Integration](#Active-Storage-Integration)
|
19
28
|
|
20
|
-
|
21
|
-
To install the Cloudinary Ruby GEM, run:
|
29
|
+
## Key Features
|
22
30
|
|
23
|
-
|
31
|
+
- [Transform](https://cloudinary.com/documentation/rails_video_manipulation#video_transformation_examples) and
|
32
|
+
[optimize](https://cloudinary.com/documentation/rails_image_manipulation#image_optimizations) assets.
|
33
|
+
- Generate [image](https://cloudinary.com/documentation/rails_image_manipulation#deliver_and_transform_images) and
|
34
|
+
[video](https://cloudinary.com/documentation/rails_video_manipulation#rails_video_transformation_code_examples) tags.
|
35
|
+
- [Asset Management](https://cloudinary.com/documentation/rails_asset_administration).
|
36
|
+
- [Secure URLs](https://cloudinary.com/documentation/video_manipulation_and_delivery#generating_secure_https_urls_using_sdks)
|
37
|
+
.
|
24
38
|
|
25
|
-
|
39
|
+
## Version Support
|
26
40
|
|
27
|
-
|
41
|
+
| SDK Version | Ruby 1.9.3 | Ruby 2.x | Ruby 3.x |
|
42
|
+
|-------------|------------|----------|----------|
|
43
|
+
| 1.x | v | v | v |
|
28
44
|
|
29
|
-
|
45
|
+
| SDK Version | Rails 5.x | Rails 6.x |
|
46
|
+
|-------------|-----------|-----------|
|
47
|
+
| 1.x | v | v |
|
30
48
|
|
31
|
-
|
49
|
+
## Installation
|
32
50
|
|
33
|
-
|
34
|
-
|
35
|
-
Rails 3.x: edit your `Gemfile` and run `bundle install`:
|
36
|
-
|
37
|
-
gem 'carrierwave'
|
38
|
-
gem 'cloudinary'
|
39
|
-
|
40
|
-
Rails 2.x environment.rb:
|
41
|
-
|
42
|
-
config.gem 'carrierwave', :version => '~> 0.4.10'
|
43
|
-
config.gem 'cloudinary'
|
44
|
-
|
45
|
-
|
46
|
-
*Note: The CarrierWave GEM should be loaded before the Cloudinary GEM.*
|
47
|
-
|
48
|
-
### Using the source code directly
|
49
|
-
|
50
|
-
You can use the source code of this library directly instead of installing the packaged gem file.
|
51
|
-
|
52
|
-
git clone https://github.com/cloudinary/cloudinary_gem.git
|
53
|
-
|
54
|
-
# if you haven't installed bundler, do so now with:
|
55
|
-
# gem install bundler
|
56
|
-
|
57
|
-
bundle install
|
58
|
-
|
59
|
-
Finally, fetch the related assets. This process is done automatically when the packaged gem is installed.
|
60
|
-
|
61
|
-
rake cloudinary:fetch_assets
|
62
|
-
|
63
|
-
## Try it right away
|
64
|
-
|
65
|
-
Sign up for a [free account](https://cloudinary.com/users/register/free) so you can try out image transformations and seamless image delivery through CDN.
|
66
|
-
|
67
|
-
*Note: Replace `demo` in all the following examples with your Cloudinary's `cloud name`.*
|
68
|
-
|
69
|
-
Accessing an uploaded image with the `sample` public ID through a CDN:
|
70
|
-
|
71
|
-
http://res.cloudinary.com/demo/image/upload/sample.jpg
|
72
|
-
|
73
|
-
![Sample](https://res.cloudinary.com/demo/image/upload/w_0.4/sample.jpg "Sample")
|
74
|
-
|
75
|
-
Generating a 150x100 version of the `sample` image and downloading it through a CDN:
|
76
|
-
|
77
|
-
http://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill/sample.jpg
|
78
|
-
|
79
|
-
![Sample 150x100](https://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill/sample.jpg "Sample 150x100")
|
80
|
-
|
81
|
-
Converting to a 150x100 PNG with rounded corners of 20 pixels:
|
82
|
-
|
83
|
-
http://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill,r_20/sample.png
|
84
|
-
|
85
|
-
![Sample 150x150 Rounded PNG](https://res.cloudinary.com/demo/image/upload/w_150,h_100,c_fill,r_20/sample.png "Sample 150x150 Rounded PNG")
|
86
|
-
|
87
|
-
For plenty more transformation options, see our [image transformations documentation](https://cloudinary.com/documentation/image_transformations).
|
88
|
-
|
89
|
-
Generating a 120x90 thumbnail based on automatic face detection of the Facebook profile picture of Bill Clinton:
|
90
|
-
|
91
|
-
http://res.cloudinary.com/demo/image/facebook/c_thumb,g_face,h_90,w_120/billclinton.jpg
|
92
|
-
|
93
|
-
![Facebook 90x120](https://res.cloudinary.com/demo/image/facebook/c_thumb,g_face,h_90,w_120/billclinton.jpg "Facebook 90x200")
|
94
|
-
|
95
|
-
For more details, see our documentation for embedding [Facebook](https://cloudinary.com/documentation/facebook_profile_pictures) and [Twitter](https://cloudinary.com/documentation/twitter_profile_pictures) profile pictures.
|
96
|
-
|
97
|
-
|
98
|
-
## Usage
|
99
|
-
|
100
|
-
### Configuration
|
101
|
-
|
102
|
-
Each request for building a URL of a remote cloud resource must have the `cloud_name` parameter set.
|
103
|
-
Each request to our secure APIs (e.g., image uploads, eager sprite generation) must have the `api_key` and `api_secret` parameters set. See [API, URLs and access identifiers](https://cloudinary.com/documentation/api_and_access_identifiers) for more details.
|
104
|
-
|
105
|
-
Setting the `cloud_name`, `api_key` and `api_secret` parameters can be done either directly in each call to a Cloudinary method or by globally setting using a YAML configuration file.
|
106
|
-
|
107
|
-
Cloudinary looks for an optional file named cloudinary.yml, which should be located under the `config` directory of your Rails project.
|
108
|
-
It contains settings for each of your deployment environments. You can always override the values specified in `cloudinary.yml` by passing different values in specific Cloudinary calls.
|
109
|
-
|
110
|
-
You can [download your customized cloudinary.yml](https://cloudinary.com/console/cloudinary.yml) configuration file using our Management Console.
|
111
|
-
|
112
|
-
Passing the parameters manually looks like this:
|
113
|
-
|
114
|
-
``` ruby
|
115
|
-
auth = {
|
116
|
-
cloud_name: "somename",
|
117
|
-
api_key: "1234567890",
|
118
|
-
api_secret: "FooBarBaz123"
|
119
|
-
}
|
120
|
-
|
121
|
-
Cloudinary::Uploader.upload("my_picture.jpg", auth)
|
51
|
+
```bash
|
52
|
+
gem install cloudinary
|
122
53
|
```
|
123
54
|
|
55
|
+
# Usage
|
124
56
|
|
125
|
-
###
|
126
|
-
|
127
|
-
Any image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:
|
128
|
-
|
129
|
-
The following example generates an image of an uploaded `sample` image while transforming it to fill a 100x150 rectangle:
|
130
|
-
|
131
|
-
cl_image_tag("sample.jpg", :width => 100, :height => 150, :crop => :fill)
|
132
|
-
|
133
|
-
Another example, emedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:
|
134
|
-
|
135
|
-
cl_image_tag("woman.jpg", :width => 90, :height => 90,
|
136
|
-
:crop => :thumb, :gravity => :face)
|
137
|
-
|
138
|
-
You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.
|
139
|
-
|
140
|
-
Embedding a Facebook profile to match your graphic design is very simple:
|
57
|
+
### Setup
|
141
58
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
Same goes for Twitter:
|
146
|
-
|
147
|
-
twitter_name_profile_image_tag("billclinton.jpg")
|
148
|
-
|
149
|
-
![More](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **See [our documentation](https://cloudinary.com/documentation/rails_image_manipulation) for more information about displaying and transforming images in Rails**.
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
### Upload
|
154
|
-
|
155
|
-
Assuming you have your Cloudinary configuration parameters defined (`cloud_name`, `api_key`, `api_secret`), uploading to Cloudinary is very simple.
|
156
|
-
|
157
|
-
The following example uploads a local JPG to the cloud:
|
158
|
-
|
159
|
-
Cloudinary::Uploader.upload("my_picture.jpg")
|
160
|
-
|
161
|
-
The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:
|
162
|
-
|
163
|
-
cl_image_tag("abcfrmo8zul1mafopawefg.jpg")
|
164
|
-
|
165
|
-
http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg
|
166
|
-
|
167
|
-
You can also specify your own public ID:
|
168
|
-
|
169
|
-
Cloudinary::Uploader.upload("http://www.example.com/image.jpg", :public_id => 'sample_remote')
|
170
|
-
|
171
|
-
cl_image_tag("sample_remote.jpg")
|
172
|
-
|
173
|
-
http://res.cloudinary.com/demo/image/upload/sample_remote.jpg
|
174
|
-
|
175
|
-
|
176
|
-
![More](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **See [our documentation](https://cloudinary.com/documentation/rails_image_upload) for plenty more options of uploading to the cloud from your Ruby code or directly from the browser**.
|
177
|
-
|
178
|
-
|
179
|
-
### CarrierWave Integration
|
180
|
-
|
181
|
-
**Note:** Starting from version 1.1.0 the CarrierWave database format has changed to include the resource type and storage type. The new functionality
|
182
|
-
is backward compatible with the previous format. To use the old format override `use_extended_identifier?` in the Uploader and return `false`.
|
183
|
-
|
184
|
-
Cloudinary's Ruby GEM includes an optional plugin for [CarrierWave](https://github.com/jnicklas/carrierwave). If you already use CarrierWave, simply include `Cloudinary::CarrierWave` to switch to cloud storage and image processing in the cloud.
|
185
|
-
|
186
|
-
class PictureUploader < CarrierWave::Uploader::Base
|
187
|
-
include Cloudinary::CarrierWave
|
188
|
-
...
|
189
|
-
end
|
190
|
-
|
191
|
-
![More](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **For more details on CarrierWave integration see [our documentation](https://cloudinary.com/documentation/rails_carrierwave)**.
|
192
|
-
|
193
|
-
We also published an interesting blog post about [Ruby on Rails image uploads with CarrierWave and Cloudinary](https://cloudinary.com/blog/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary).
|
194
|
-
|
195
|
-
#### Neo4j integration
|
196
|
-
|
197
|
-
Starting from version 1.1.1 Cloudinary's Ruby GEM supports the use of carrierwave with Neo4j.
|
198
|
-
|
199
|
-
### JavaScript support library
|
200
|
-
|
201
|
-
During the installation or update of the Cloudinary GEM, the latest Cloudinary JavaScript library is automatically fetched and bundled with the GEM.
|
202
|
-
|
203
|
-
To use the JavaScript files you need to include them in your application, for example:
|
204
|
-
|
205
|
-
```
|
206
|
-
<%= javascript_include_tag("jquery.ui.widget", "jquery.iframe-transport",
|
207
|
-
"jquery.fileupload", "jquery.cloudinary") %>
|
59
|
+
```ruby
|
60
|
+
require 'cloudinary'
|
208
61
|
```
|
209
62
|
|
210
|
-
|
63
|
+
### Transform and Optimize Assets
|
64
|
+
- [See full documentation](https://cloudinary.com/documentation/rails_image_manipulation).
|
211
65
|
|
212
|
-
```
|
213
|
-
|
66
|
+
```ruby
|
67
|
+
cl_image_tag("sample.jpg", :width => 100, :height => 150, :crop => :fill)
|
214
68
|
```
|
215
69
|
|
216
|
-
|
70
|
+
### Upload
|
71
|
+
- [See full documentation](https://cloudinary.com/documentation/rails_image_and_video_upload).
|
72
|
+
- [Learn more about configuring your uploads with upload presets](https://cloudinary.com/documentation/upload_presets).
|
217
73
|
|
218
|
-
```
|
219
|
-
|
74
|
+
```ruby
|
75
|
+
Cloudinary::Uploader.upload("my_picture.jpg")
|
220
76
|
```
|
221
77
|
|
222
|
-
|
223
|
-
|
224
|
-
The Cloudinary JavaScript library utilizes the Blueimp File Upload library to support image uploading from the browser. See the [documentation](https://cloudinary.com/documentation/jquery_image_upload) for more details.
|
225
|
-
|
226
|
-
|Important|
|
227
|
-
|---------|
|
228
|
-
|Starting with version 2.0 of the Cloudinary JavaScript library, the Cloudinary extension to the Blueimp File Upload library is no longer initialized automatically. Instead you need to explicitly set it up as described below.|
|
229
|
-
|
230
|
-
To initialize the File Upload library with Cloudinary include the following code in your page:
|
231
|
-
|
232
|
-
```javascript
|
233
|
-
$(function() {
|
234
|
-
if($.fn.cloudinary_fileupload !== undefined) {
|
235
|
-
$("input.cloudinary-fileupload[type=file]").cloudinary_fileupload();
|
236
|
-
}
|
237
|
-
});
|
238
|
-
```
|
78
|
+
### CarrierWave Integration
|
79
|
+
- [See full documentation](https://cloudinary.com/documentation/rails_carrierwave).
|
239
80
|
|
81
|
+
### Active Storage Integration
|
82
|
+
- [See full documentation](https://cloudinary.com/documentation/rails_activestorage).
|
240
83
|
|
241
|
-
|
84
|
+
### Security options
|
85
|
+
- [See full documentation](https://cloudinary.com/documentation/solution_overview#security).
|
242
86
|
|
243
87
|
### Samples
|
88
|
+
- See [samples folder](https://github.com/cloudinary/cloudinary_gem/tree/master/samples).
|
244
89
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
## Additional resources ##########################################################
|
249
|
-
|
250
|
-
Additional resources are available at:
|
251
|
-
|
252
|
-
* [Website](https://cloudinary.com)
|
253
|
-
* [Interactive demo](https://demo.cloudinary.com/default)
|
254
|
-
* [Documentation](https://cloudinary.com/documentation)
|
255
|
-
* [Knowledge Base](https://support.cloudinary.com/hc/en-us)
|
256
|
-
* [Documentation for Ruby on Rails integration](https://cloudinary.com/documentation/rails_integration)
|
257
|
-
* [Ruby on Rails image upload documentation](https://cloudinary.com/documentation/rails_image_upload)
|
258
|
-
* [Ruby on Rails image manipulation documentation](https://cloudinary.com/documentation/rails_image_manipulation)
|
259
|
-
* [Image transformations documentation](https://cloudinary.com/documentation/image_transformations)
|
260
|
-
|
261
|
-
## Support
|
90
|
+
## Contributions
|
91
|
+
- See [CONTRIBUTING](CONTRIBUTING.md).
|
262
92
|
|
263
|
-
|
93
|
+
## Get Help
|
264
94
|
|
265
|
-
|
95
|
+
If you run into an issue or have a question, you can either:
|
266
96
|
|
267
|
-
|
97
|
+
- Issues related to the SDK: [Open a GitHub issue](https://github.com/cloudinary/cloudinary_gem/issues).
|
98
|
+
- Issues related to your account: [Open a support ticket](https://cloudinary.com/contact)
|
268
99
|
|
269
|
-
##
|
100
|
+
## About Cloudinary
|
270
101
|
|
271
|
-
|
102
|
+
Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently
|
103
|
+
manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive
|
104
|
+
and personalized visual-media experiences—irrespective of the viewing device.
|
272
105
|
|
273
|
-
##
|
106
|
+
## Additional Resources
|
274
107
|
|
275
|
-
|
108
|
+
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references):
|
109
|
+
Comprehensive references, including syntax and examples for all SDKs.
|
110
|
+
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
|
111
|
+
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on
|
112
|
+
YouTube.
|
113
|
+
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and
|
114
|
+
on-site courses.
|
115
|
+
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop
|
116
|
+
for all code explorers, Postman collections, and feature demos found in the docs.
|
117
|
+
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should
|
118
|
+
develop next.
|
119
|
+
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to
|
120
|
+
other Cloudinary developers.
|
121
|
+
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
|
122
|
+
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and
|
123
|
+
more.
|
276
124
|
|
125
|
+
## Licence
|
277
126
|
|
127
|
+
Released under the MIT license.
|
data/cloudinary.gemspec
CHANGED
@@ -27,6 +27,10 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency "rest-client"
|
28
28
|
end
|
29
29
|
|
30
|
+
if RUBY_VERSION >= "3.0.0"
|
31
|
+
s.add_development_dependency "rexml"
|
32
|
+
end
|
33
|
+
|
30
34
|
s.add_development_dependency "actionpack"
|
31
35
|
s.add_development_dependency "nokogiri"
|
32
36
|
|
@@ -39,7 +43,12 @@ Gem::Specification.new do |s|
|
|
39
43
|
s.add_development_dependency "sqlite3"
|
40
44
|
s.add_development_dependency "rspec", '>=3.5'
|
41
45
|
s.add_development_dependency "rspec-retry"
|
42
|
-
|
46
|
+
|
47
|
+
if RUBY_VERSION >= "3.0.0"
|
48
|
+
s.add_development_dependency "rails", "~> 6.0.3"
|
49
|
+
elsif RUBY_VERSION >= "2.2.2"
|
50
|
+
s.add_development_dependency "rails", "~> 5.2"
|
51
|
+
end
|
43
52
|
|
44
53
|
s.add_development_dependency "railties", "<= 4.2.7" if RUBY_VERSION <= "1.9.3"
|
45
54
|
s.add_development_dependency "rspec-rails"
|
@@ -128,23 +128,18 @@ class Cloudinary::AccountApi
|
|
128
128
|
end
|
129
129
|
|
130
130
|
# Lists users in the account.
|
131
|
-
# @param [Boolean] pending
|
131
|
+
# @param [Boolean] pending Limit results to pending users (true), users that are not pending (false), or all users (nil, the default)
|
132
132
|
# @param [Array<String>] user_ids A list of up to 100 user IDs. When provided, other parameters are ignored.
|
133
133
|
# @param [String] prefix Returns users where the name or email address begins with the specified case-insensitive string.
|
134
134
|
# @param [String] sub_account_id Only returns users who have access to the specified account.
|
135
135
|
# @param [Object] options additional options
|
136
136
|
def self.users(pending = nil, user_ids = [], prefix = nil, sub_account_id = nil, options = {})
|
137
|
-
params =
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
prefix: prefix,
|
144
|
-
sub_account_id: sub_account_id,
|
145
|
-
pending: pending
|
146
|
-
}
|
147
|
-
end
|
137
|
+
params = {
|
138
|
+
ids: user_ids,
|
139
|
+
prefix: prefix,
|
140
|
+
sub_account_id: sub_account_id,
|
141
|
+
pending: pending
|
142
|
+
}
|
148
143
|
|
149
144
|
call_account_api(:get, 'users', params, options.merge(content_type: :json))
|
150
145
|
end
|
@@ -221,8 +216,9 @@ class Cloudinary::AccountApi
|
|
221
216
|
api_secret = options[:provisioning_api_secret] || Cloudinary.account_config.provisioning_api_secret || raise('Must supply provisioning api_secret')
|
222
217
|
|
223
218
|
params.reject! { |_, v| v.nil? }
|
219
|
+
auth = { :key => api_key, :secret => api_secret }
|
224
220
|
|
225
|
-
call_cloudinary_api(method, uri,
|
221
|
+
call_cloudinary_api(method, uri, auth, params, options) do |cloudinary, inner_uri|
|
226
222
|
[cloudinary, 'v1_1', 'provisioning', 'accounts', account_id, inner_uri]
|
227
223
|
end
|
228
224
|
end
|