spree_cloudinary 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cloudinary_uploader.rb +30 -0
- data/app/models/spree/image_decorator.rb +1 -32
- data/lib/spree_cloudinary/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5086da93b886c9f4d0263fc2cf5b2e4852ff6561
|
4
|
+
data.tar.gz: 846a66a5c1d7530f1fa46eaad8928aac7d02fd12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f70ecfcad558a5efbb7613a40c2f4e9b23debafb9613a3c82dee67a085a2ec27a5bd55e3a65c196ccef6b558e648b3a561bb67bdef79c160ce9c1e5fedfdbd
|
7
|
+
data.tar.gz: 43366fc26096ea5d96116eb2ca84f06b8dda85c0f7bb1661df85fe6f0621b351b5da31303f00bcc3047b380c7ea820b6d2ef9e22d661187ca01bdbe33e95277c
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class CloudinaryUploader < CarrierWave::Uploader::Base
|
2
|
+
include CarrierWave::Compatibility::Paperclip
|
3
|
+
include Cloudinary::CarrierWave
|
4
|
+
|
5
|
+
process :convert => 'png'
|
6
|
+
# Spree looks in attachment#errors, so just delegate to model#errors
|
7
|
+
delegate :errors, :to => :model
|
8
|
+
|
9
|
+
# Match the path defined in Spree::Image
|
10
|
+
def paperclip_path
|
11
|
+
"assets/products/:id/:style/:basename.:extension"
|
12
|
+
end
|
13
|
+
|
14
|
+
# These are the versions defined in Spree::Image
|
15
|
+
version :mini do
|
16
|
+
process :resize_to_fit => [48, 48]
|
17
|
+
end
|
18
|
+
|
19
|
+
version :small do
|
20
|
+
process :resize_to_fit => [100, 100]
|
21
|
+
end
|
22
|
+
|
23
|
+
version :product do
|
24
|
+
process :resize_to_fit => [240, 240]
|
25
|
+
end
|
26
|
+
|
27
|
+
version :large do
|
28
|
+
process :resize_to_fit => [600, 600]
|
29
|
+
end
|
30
|
+
end
|
@@ -1,36 +1,5 @@
|
|
1
1
|
Spree::Image.class_eval do
|
2
|
-
|
3
|
-
include CarrierWave::Compatibility::Paperclip
|
4
|
-
include Cloudinary::CarrierWave
|
5
|
-
|
6
|
-
process :convert => 'png'
|
7
|
-
# Spree looks in attachment#errors, so just delegate to model#errors
|
8
|
-
delegate :errors, :to => :model
|
9
|
-
|
10
|
-
# Match the path defined in Spree::Image
|
11
|
-
def paperclip_path
|
12
|
-
"assets/products/:id/:style/:basename.:extension"
|
13
|
-
end
|
14
|
-
|
15
|
-
# These are the versions defined in Spree::Image
|
16
|
-
version :mini do
|
17
|
-
process :resize_to_fit => [48, 48]
|
18
|
-
end
|
19
|
-
|
20
|
-
version :small do
|
21
|
-
process :resize_to_fit => [100, 100]
|
22
|
-
end
|
23
|
-
|
24
|
-
version :product do
|
25
|
-
process :resize_to_fit => [240, 240]
|
26
|
-
end
|
27
|
-
|
28
|
-
version :large do
|
29
|
-
process :resize_to_fit => [600, 600]
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
mount_uploader :attachment, Uploader, :mount_on => :attachment_file_name
|
2
|
+
mount_uploader :attachment, CloudinaryUploader, :mount_on => :attachment_file_name
|
34
3
|
|
35
4
|
# Get rid of the paperclip callbacks
|
36
5
|
def save_attached_files; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thach Chau
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- LICENSE.txt
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
|
+
- app/models/cloudinary_uploader.rb
|
125
126
|
- app/models/spree/image_decorator.rb
|
126
127
|
- lib/spree_cloudinary.rb
|
127
128
|
- lib/spree_cloudinary/engine.rb
|