shrine-cloudinary 0.5.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: af93e9f323d845452fe62288a84349edd31aac44
4
- data.tar.gz: c71a22621e93b73eec3501cdbfcfe3ded40e5a37
2
+ SHA256:
3
+ metadata.gz: 045fee1be579e6ad2ec58861ddc5de2b1733b558a0b2b6b7fa57c2ba12b0e7a5
4
+ data.tar.gz: cbe61d4e2f44c73cddb27f5715f8e8ab18ecbc6050864cb8649b5501375e75a7
5
5
  SHA512:
6
- metadata.gz: 6f7d9e5f393a1f5819b8c0bcc2ab5b96226ef7de926a5e14a25db15a8d03113465285fc0f68435254125c93c38d720cf012667a21ddfac5f757321a42f0f1b07
7
- data.tar.gz: 5345d19942337df8d58cf67a4fd722c7c2eaecd56c07a43b2613d2f94911090497e4d0bf160020e8d2de0979105bbb78f605e89e5a3d8aa8efd079381752dc04
6
+ metadata.gz: 84370942b03354fb121f96a857982a036cc81b0c0aadceb98859ac082e285c3efedb09a939128d49accbe78b154bb4299fcf7d17e2fe9b4a27566882cd8c0972
7
+ data.tar.gz: 537c4da719d63cfe120cbd0a959755c63f1f237b467c94c93b744a4c88809685b9fe1c6059a87e3e21b0af07da73e830177d0f6efb5db3bf4b26d0cf6500ae33
data/README.md CHANGED
@@ -292,7 +292,7 @@ This gem has been inspired by Cloudinary's [CarrierWave integration].
292
292
  [MIT](http://opensource.org/licenses/MIT)
293
293
 
294
294
  [Cloudinary]: http://cloudinary.com/
295
- [Shrine]: https://github.com/janko-m/shrine
295
+ [Shrine]: https://github.com/shrinerb/shrine
296
296
  [CarrierWave integration]: https://github.com/cloudinary/cloudinary_gem
297
297
  [Cloudinary options]: http://cloudinary.com/documentation/image_upload_api_reference#upload
298
298
  [Rails image manipulation]: http://cloudinary.com/documentation/rails_image_manipulation
@@ -1,6 +1,6 @@
1
1
  require "shrine"
2
2
  require "cloudinary"
3
- require "down"
3
+ require "down/http"
4
4
 
5
5
  class Shrine
6
6
  module Storage
@@ -17,7 +17,7 @@ class Shrine
17
17
  end
18
18
 
19
19
  def upload(io, id, shrine_metadata: {}, **upload_options)
20
- options = {public_id: public_id(id)}
20
+ options = { public_id: public_id(id) }
21
21
  options.update(default_options)
22
22
  options.update(@upload_options)
23
23
  options.update(upload_options)
@@ -42,8 +42,8 @@ class Shrine
42
42
  io.is_a?(UploadedFile) && io.storage.is_a?(Storage::Cloudinary)
43
43
  end
44
44
 
45
- def open(id)
46
- Down.open(url(id))
45
+ def open(id, **options)
46
+ Down::Http.open(url(id), **options)
47
47
  end
48
48
 
49
49
  def exists?(id)
@@ -68,7 +68,7 @@ class Shrine
68
68
  end
69
69
 
70
70
  def presign(id = nil, **options)
71
- upload_options = id ? {public_id: public_id(id)} : {folder: prefix}
71
+ upload_options = id ? { public_id: public_id(id) } : { folder: prefix }
72
72
  upload_options.update(@upload_options)
73
73
 
74
74
  fields = ::Cloudinary::Uploader.build_upload_params(upload_options.merge(options))
@@ -78,7 +78,7 @@ class Shrine
78
78
 
79
79
  url = ::Cloudinary::Utils.cloudinary_api_url("upload", default_options)
80
80
 
81
- Struct.new(:url, :fields).new(url, fields)
81
+ { method: :post, url: url, fields: fields }
82
82
  end
83
83
 
84
84
  protected
@@ -120,7 +120,7 @@ class Shrine
120
120
  end
121
121
 
122
122
  def default_options
123
- {resource_type: resource_type, type: type}
123
+ { resource_type: resource_type, type: type }
124
124
  end
125
125
 
126
126
  def make_rest_client_recognize_as_file!(io)
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-cloudinary"
3
- gem.version = "0.5.1"
3
+ gem.version = "1.0.0"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
7
7
  gem.summary = "Provides Cloudinary storage for Shrine."
8
- gem.homepage = "https://github.com/janko-m/shrine-cloudinary"
8
+ gem.homepage = "https://github.com/shrinerb/shrine-cloudinary"
9
9
  gem.authors = ["Janko Marohnić"]
10
10
  gem.email = ["janko.marohnic@gmail.com"]
11
11
  gem.license = "MIT"
@@ -13,9 +13,10 @@ Gem::Specification.new do |gem|
13
13
  gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "*.gemspec"]
14
14
  gem.require_path = "lib"
15
15
 
16
- gem.add_dependency "shrine", "~> 2.2"
16
+ gem.add_dependency "shrine", "~> 2.11"
17
17
  gem.add_dependency "cloudinary", "< 2"
18
- gem.add_dependency "down", ">= 2.3.3"
18
+ gem.add_dependency "down", "~> 4.4"
19
+ gem.add_dependency "http", "~> 3.2"
19
20
 
20
21
  gem.add_development_dependency "rake"
21
22
  gem.add_development_dependency "minitest"
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: 0.5.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2018-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shrine
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.2'
19
+ version: '2.11'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.2'
26
+ version: '2.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cloudinary
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +42,30 @@ dependencies:
42
42
  name: down
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.3
47
+ version: '4.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: http
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 2.3.3
68
+ version: '3.2'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -105,7 +119,7 @@ files:
105
119
  - README.md
106
120
  - lib/shrine/storage/cloudinary.rb
107
121
  - shrine-cloudinary.gemspec
108
- homepage: https://github.com/janko-m/shrine-cloudinary
122
+ homepage: https://github.com/shrinerb/shrine-cloudinary
109
123
  licenses:
110
124
  - MIT
111
125
  metadata: {}
@@ -125,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  version: '0'
126
140
  requirements: []
127
141
  rubyforge_project:
128
- rubygems_version: 2.6.11
142
+ rubygems_version: 2.7.6
129
143
  signing_key:
130
144
  specification_version: 4
131
145
  summary: Provides Cloudinary storage for Shrine.