uploadcare-ruby 4.3.4 → 4.3.5

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: a74c3c72e0515754e232f7e424044fb052c3e03e5ff785b09c09ef512127f768
4
- data.tar.gz: 80ed959b129a9d33a21bfe0dee21c6745326cd427a0c1dc88c198e75ce5819e7
3
+ metadata.gz: c1fcdb502b1f16f3ffac580b7f89e3b136b790aa6162ef7d3ff4e2fdce535e09
4
+ data.tar.gz: 58e9cdc245f4590ae88645c31bf413c938f5b4052658333a1e69bf57314dbef8
5
5
  SHA512:
6
- metadata.gz: 81fe14594ea08fd8675dbfd90283609c8b5294216dee45e02a85c8c66161a15ce540938f966162a2527504f62d9c8533bfbd073392fdeb5bede1b69a40145e41
7
- data.tar.gz: 56ec68397a62fd77a8db4128a00bd9011b14340f745349691a7334c317a3adbae5c7c39496440c35c2288371e00a47ddb0dc9740045e9c56461521b7c22e0ee5
6
+ metadata.gz: 7b545586071da58448205a9f8be81d61f15510f69e5b3d36b1d79a1246e0af20ca04a839a80670b8b1f42a902062c0ab8b85781c592f16b314e6f24bc448f4f5
7
+ data.tar.gz: b916141770f662c8763f8fc94a46b0f81ae971dd28ba4987f78a2a17ef955f7693fa546e4b148dd610ad95f3cd76c5ba583e518393be4c8f3546737fbbb6c196
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.3.5 — 2023-09-19
4
+
5
+ ### Changed
6
+
7
+ * Updated behavior to exclude sending blank values in the `store` param.
8
+
9
+
3
10
  ## 4.3.4 — 2023-05-16
4
11
 
5
12
  ### Changed
@@ -94,21 +94,24 @@ module Uploadcare
94
94
  )
95
95
  end
96
96
 
97
- STORE_VALUES_MAP = {
98
- true => '1',
99
- false => '0'
100
- }.freeze
101
-
102
97
  # Prepare upload_from_url initial request body
103
98
  def upload_from_url_body(url, options = {})
104
99
  HTTP::FormData::Multipart.new(
105
100
  options.merge(
106
101
  'pub_key' => Uploadcare.config.public_key,
107
102
  'source_url' => url,
108
- 'store' => STORE_VALUES_MAP[options[:store]]
103
+ 'store' => store_value(options[:store])
109
104
  )
110
105
  )
111
106
  end
107
+
108
+ def store_value(store)
109
+ case store
110
+ when true, '1', 1 then '1'
111
+ when false, '0', 0 then '0'
112
+ else 'auto'
113
+ end
114
+ end
112
115
  end
113
116
  end
114
117
  end
@@ -12,18 +12,19 @@ module Uploadcare
12
12
  def call(options = {})
13
13
  {
14
14
  'UPLOADCARE_PUB_KEY' => Uploadcare.config.public_key,
15
- 'UPLOADCARE_STORE' => store(options[:store]),
15
+ 'UPLOADCARE_STORE' => store_value(options[:store]),
16
16
  'signature' => (Upload::SignatureGenerator.call if Uploadcare.config.sign_uploads)
17
17
  }.merge(metadata(options)).compact
18
18
  end
19
19
 
20
20
  private
21
21
 
22
- def store(store)
23
- store = 'auto' if store.nil?
24
- store = '0' if store == false
25
- store = '1' if store == true
26
- store
22
+ def store_value(store)
23
+ case store
24
+ when true, '1', 1 then '1'
25
+ when false, '0', 0 then '0'
26
+ else 'auto'
27
+ end
27
28
  end
28
29
 
29
30
  def metadata(options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uploadcare
4
- VERSION = '4.3.4'
4
+ VERSION = '4.3.5'
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadcare-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.4
4
+ version: 4.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@dmitrijivanchenko (Dmitrij Ivanchenko), @T0mbery (Andrey Aksenov)"
8
8
  - kraft001 (Konstantin Rafalskii)
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-05-16 00:00:00.000000000 Z
12
+ date: 2023-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mimemagic
@@ -158,7 +158,7 @@ metadata:
158
158
  bug_tracker_uri: https://github.com/uploadcare/uploadcare-ruby/issues
159
159
  documentation_uri: https://www.rubydoc.info/gems/uploadcare-ruby/
160
160
  rubygems_mfa_required: 'true'
161
- post_install_message:
161
+ post_install_message:
162
162
  rdoc_options: []
163
163
  require_paths:
164
164
  - lib
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubygems_version: 3.4.10
179
- signing_key:
179
+ signing_key:
180
180
  specification_version: 4
181
181
  summary: Ruby wrapper for uploadcare API
182
182
  test_files: []