cloudinary 2.3.1 → 2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0ad3ba5b49a838e7d13426ba67a292f27831034fca177ce31e8858bd3a214f6
4
- data.tar.gz: 91b672ddf6bec07bdddd0691e29b8e50d28d757627bbd22384c62afd0661a73a
3
+ metadata.gz: c5d13ba60560d448d8cfb1aaf87d40c7c12fa8879ff417b0e82c88694688a76a
4
+ data.tar.gz: 4cc35e584e9e347ba23c6b04f2eee8e8fc9249fd8ec399d4aba08af1a38433ef
5
5
  SHA512:
6
- metadata.gz: b2189e9c87739637af5a46b989d76ee14b7ccf024228a785fdc54bd875176ece44a3f72ad46659bf10ec1a86a7686faca19921b89faa4b7deaed47c616257457
7
- data.tar.gz: 644dbad25b178cbc92928b9b1c2e7e51b4fcd0c23a2bd1d7a48f054db6c4fea640e8b998138fe914cbd7ea3ea8b06c28a449429c5b0d20a45e6d2662140e98b2
6
+ metadata.gz: db4eed04971bebb7aff1b06907a953e6c69efcaddc20ef5cd422d3c0970589b40aa33b393aa94e54c841290ac9e6c3ad42311807b1a1f609f5bd2d9fe454b6d7
7
+ data.tar.gz: f48ef74d17808d6ff4b126f6d0def6400a455641b7b0c6987194d5b9cb24ccd045ac0f1bb89d716dfd760f86ee3ce92d113055794bd76491307d5d044f62628e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ 2.4.0 / 2025-08-31
2
+ ==================
3
+
4
+ New functionality and features
5
+ ------------------------------
6
+
7
+ * Add support for providing upload parameters in CarrierWave
8
+
1
9
  2.3.1 / 2025-06-17
2
10
  ==================
3
11
 
@@ -402,7 +402,7 @@ class Cloudinary::Api
402
402
  #
403
403
  # @raise [Cloudinary::Api::Error]
404
404
  #
405
- # @see https://cloudinary.com/documentation/admin_api##delete_resources
405
+ # @see https://cloudinary.com/documentation/admin_api#delete_resources
406
406
  def self.delete_derived_resources(derived_resource_ids, options={})
407
407
  uri = "derived_resources"
408
408
  call_api(:delete, uri, { :derived_resource_ids => derived_resource_ids }, options)
@@ -48,6 +48,10 @@ module Cloudinary::CarrierWave
48
48
  def tags(*tags)
49
49
  process :tags=>tags
50
50
  end
51
+
52
+ def upload_params(params={})
53
+ process :upload_params => params
54
+ end
51
55
  end
52
56
 
53
57
  def set_or_yell(hash, attr, value)
@@ -135,6 +139,19 @@ module Cloudinary::CarrierWave
135
139
  @tags
136
140
  end
137
141
 
142
+ def upload_params
143
+ @upload_params ||= begin
144
+ params_processors = self.all_processors.select{|processor| processor[0] == :upload_params}
145
+ merged_params = {}
146
+ params_processors.each do |processor|
147
+ merged_params.merge!(processor[1] || {})
148
+ end
149
+ merged_params
150
+ end
151
+ raise CloudinaryException, "upload_params cannot be used in versions." if @upload_params.present? && self.version_name.present?
152
+ @upload_params
153
+ end
154
+
138
155
  def requested_format
139
156
  format_processor = self.all_processors.find{|processor| processor[0] == :convert}
140
157
  if format_processor
@@ -35,6 +35,10 @@ class Cloudinary::CarrierWave::Storage < ::CarrierWave::Storage::Abstract
35
35
  params[:eager] = eager_versions.map{|version| [version.transformation, version.format]} if eager_versions.length > 0
36
36
  params[:type]=uploader.class.storage_type
37
37
 
38
+ # Merge any custom upload parameters
39
+ custom_params = uploader.upload_params
40
+ params.merge!(custom_params) if custom_params.present?
41
+
38
42
  params[:resource_type] ||= :auto
39
43
  upload_method = uploader.respond_to?(:upload_chunked?) && uploader.upload_chunked? ? "upload_large" : "upload"
40
44
  uploader.metadata = Cloudinary::Uploader.send(upload_method, data, params)
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "2.3.1"
3
+ VERSION = "2.4.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nadav Soferman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-06-17 00:00:00.000000000 Z
13
+ date: 2025-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday