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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b8e13a67c158deb5255b9a047415eca407baded8da093d1710c2a63d4e505fb
4
- data.tar.gz: ecdfa43b53f32bca080085f2a1ffafe6393ba2c6739137843d54913fdadd0327
3
+ metadata.gz: c0eaed2568e6fdbdc41b8c47337b1c514f0db410c597c3b5727eb3de9ffa2367
4
+ data.tar.gz: b946998c24efbe8fe0307ef55ea9971233be36623cdbcdbd283306c319132d02
5
5
  SHA512:
6
- metadata.gz: 84811ac4a7369eff4cd958e0a111151dc98a9998ef0a087959b2ecb41cc883def34ffe4db77d0eb2ec66be752106f654a8884d01aad7e8d5666a02ef80555ca9
7
- data.tar.gz: 5830376aea6021ddf9b557ddab8ebe3b1157cc08ecc5badaead61cf024d24bed9013b3264b350c362b0b3b4f63eb295496595b07d900a36a0f2efe5b3a7a3912
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)&.path
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)&.url
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shimmer
4
- VERSION = "0.0.23"
4
+ VERSION = "0.0.24"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ravens