shrine-cloudinary 0.1.0 → 0.1.1

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
2
  SHA1:
3
- metadata.gz: b19b7d283d488e20abf633289dedc3d75ac9a7af
4
- data.tar.gz: 46697c64a6bd24e8817980dc7e6fe751f116a98a
3
+ metadata.gz: 41dea0917908eed7217824a177712ab780ac44d8
4
+ data.tar.gz: 6413d85af1e21214988f7cd5201dbf13d6a535fe
5
5
  SHA512:
6
- metadata.gz: e0daa86740883310ba8da21250e453e5e749e10ee2eb355dcfe13e44f67a132295a6161308e0c50e1d93f439b0ab9f0b7ecab3515da017f8d1cc88eeb641ecfe
7
- data.tar.gz: 947ead1c71d809c52bd4ee4fac40823acefd7176ee993f83f5bc45c50a904ef72027506a5fdbe7b04f19ac683b7eecb41479e00f1d6569c9f2a6b27c25c3c522
6
+ metadata.gz: a39bd818d6e1a60bcbaf5d5d8a8d6253e2ce8d924bdd228efc5fdc5150ebf78594343ab23fa9d9f11632ef5050b8be7c120eb8fbc6835c53645e55d371f9316e
7
+ data.tar.gz: 727ad30490548dd17429afa49b0e1528b4d3d2bbaeb89a5a18a0ae52cb0baee1f4163f56693cf150f63dbc2968c29679bc1511741835e26e3794887b976d8c21
data/README.md CHANGED
@@ -20,7 +20,7 @@ Cloudinary.config(
20
20
  api_key: "...",
21
21
  api_secret: "...",
22
22
  )
23
-
23
+ ```
24
24
 
25
25
  You can now initialize your storage:
26
26
 
@@ -99,6 +99,9 @@ user.avatar_url(transformation: "medium")
99
99
  user.avatar_url(transformation: "large")
100
100
  ```
101
101
 
102
+ Read [this Cloudinary section](http://cloudinary.com/documentation/rails_image_manipulation)
103
+ for all URL options you can pass in.
104
+
102
105
  ### Large files
103
106
 
104
107
  If you're uploading large files with Cloudinary (like videos), you can take
@@ -23,10 +23,13 @@ class Shrine
23
23
  result =
24
24
  if remote?(io)
25
25
  uploader.upload(io.storage.url(io.id), **options)
26
- elsif large?(io)
27
- uploader.upload_large(io, chunk_size: chunk_size, **options)
28
26
  else
29
- uploader.upload(io, **options)
27
+ io = io.download if io.is_a?(UploadedFile)
28
+ if large?(io)
29
+ uploader.upload_large(io, chunk_size: chunk_size, **options)
30
+ else
31
+ uploader.upload(io, **options)
32
+ end
30
33
  end
31
34
 
32
35
  update_id!(result, id)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "shrine-cloudinary"
3
- gem.version = "0.1.0"
3
+ gem.version = "0.1.1"
4
4
 
5
5
  gem.required_ruby_version = ">= 2.1"
6
6
 
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.1.0
4
+ version: 0.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: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cloudinary