shrine-cloudinary 1.1.0 → 1.1.1

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: 6fd427e7ba7152f8dcaa9d77157e5d6ab22ab48074ba06a3ed00523f81849ff7
4
- data.tar.gz: 3b0c58833d9d2894b23633c365c9feff1fdf0e123f47cef0e8727e295ed96cfd
3
+ metadata.gz: 5d22a8c603098b55d7f316eb3203e31bd97d372c46ed0cc6ba74ce280100e40a
4
+ data.tar.gz: c0cef847e8dd916b11d9edbea699b728c6344dde58e2f518dc830d21a873fd9d
5
5
  SHA512:
6
- metadata.gz: 3cf2577f5450d758fcedd96b64a10daf73316d2842a7d1bc16c0c7e44dbb96a3562af4ba77da0721e333e93e2456a0426f535d4cff6f28d224ee22069aced825
7
- data.tar.gz: 92e263bf7b5cd8905f7834f4ed12a64b892e36adc8a3bc7235db464cd43c33edb390ba10e366068cc5b9c556b75ce004200a11be2c269f432ce5c78f1060d180
6
+ metadata.gz: e27e178e8acdb0bd950ab2269bd7ba21b3d553f3c37f9806e65fa43a6775386bbb6478e1e06af93fec2c1abf91a2990daadcd8c218fd1696ea80b11686758097
7
+ data.tar.gz: fbabab23292519d2d661afe2b6cf00e83906caa6ff465099b13d9b8ab30c6998a508cfa96aba1c1896906874c4547e04363f80872a99d073febf67d6aef74f8b
@@ -95,12 +95,12 @@ class Shrine
95
95
  if remote?(io)
96
96
  uploader.upload(io.url, **options)
97
97
  else
98
- make_rest_client_recognize_as_file!(io)
99
- if large?(io)
100
- io.instance_eval { def match(*); false; end } # https://github.com/cloudinary/cloudinary_gem/pull/260
101
- uploader.upload_large(io, chunk_size: chunk_size, **options)
102
- else
103
- uploader.upload(io, **options)
98
+ Shrine.with_file(io) do |file|
99
+ if large?(file)
100
+ uploader.upload_large(file, chunk_size: chunk_size, **options)
101
+ else
102
+ uploader.upload(file, **options)
103
+ end
104
104
  end
105
105
  end
106
106
  end
@@ -121,11 +121,6 @@ class Shrine
121
121
  { resource_type: resource_type, type: type }
122
122
  end
123
123
 
124
- def make_rest_client_recognize_as_file!(io)
125
- io.instance_eval { def path; "file"; end } unless io.respond_to?(:path)
126
- io.instance_eval { def original_filename; "file"; end } if io.respond_to?(:original_filename)
127
- end
128
-
129
124
  def update_id!(result, id)
130
125
  uploaded_id = result.fetch("public_id")
131
126
  uploaded_id = uploaded_id.match("#{prefix}/").post_match if prefix
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-cloudinary"
3
- gem.version = "1.1.0"
3
+ gem.version = "1.1.1"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_path = "lib"
15
15
 
16
16
  gem.add_dependency "shrine", ">= 3.0.0.rc", "< 4"
17
- gem.add_dependency "cloudinary", "< 2"
17
+ gem.add_dependency "cloudinary", "~> 1.12"
18
18
  gem.add_dependency "down", "~> 5.0"
19
19
  gem.add_dependency "http", ">= 3.2", "< 5"
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrine-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-28 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -34,16 +34,16 @@ dependencies:
34
34
  name: cloudinary
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "<"
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '2'
39
+ version: '1.12'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "<"
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '2'
46
+ version: '1.12'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: down
49
49
  requirement: !ruby/object:Gem::Requirement