shimmer 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shimmer/utils/file_helper.rb +12 -4
- data/lib/shimmer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0eaed2568e6fdbdc41b8c47337b1c514f0db410c597c3b5727eb3de9ffa2367
|
4
|
+
data.tar.gz: b946998c24efbe8fe0307ef55ea9971233be36623cdbcdbd283306c319132d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13279649e9331c200c8491974f57fc659aff3b60242f93683fba9a55d0d75583a32c6b9eaab4a4d128207f5be416b55493af629cd87edd02d01cc52c946da4da
|
7
|
+
data.tar.gz: 8f200cd8ed792dc4a33d2ab7fc2d0607a00ea9a2a4ad32f278d655a21d1510d7cd614483d15077cb99ab2ca9b124c6ec94b02cf8471740b0b17497f94bc61354
|
@@ -27,19 +27,27 @@ module Shimmer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def image_file_path(source, width: nil, height: nil)
|
30
|
-
image_file_proxy(source, width: width, height: height)
|
30
|
+
image_file_proxy(source, width: width, height: height, return_type: :path)
|
31
31
|
end
|
32
32
|
|
33
33
|
def image_file_url(source, width: nil, height: nil)
|
34
|
-
image_file_proxy(source, width: width, height: height)
|
34
|
+
image_file_proxy(source, width: width, height: height, return_type: :url)
|
35
35
|
end
|
36
36
|
|
37
|
-
def image_file_proxy(source, width: nil, height: nil)
|
37
|
+
def image_file_proxy(source, width: nil, height: nil, return_type: nil)
|
38
38
|
return if source.blank?
|
39
39
|
return source if source.is_a?(String)
|
40
40
|
|
41
41
|
blob = source.try(:blob) || source
|
42
|
-
Shimmer::FileProxy.new(blob_id: blob.id, width: width, height: height)
|
42
|
+
proxy = Shimmer::FileProxy.new(blob_id: blob.id, width: width, height: height)
|
43
|
+
case return_type
|
44
|
+
when nil
|
45
|
+
proxy
|
46
|
+
when :path
|
47
|
+
proxy.path
|
48
|
+
when :url
|
49
|
+
proxy.url
|
50
|
+
end
|
43
51
|
end
|
44
52
|
end
|
45
53
|
end
|
data/lib/shimmer/version.rb
CHANGED