cloudinary 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,8 @@ module CloudinaryHelper
26
26
 
27
27
  def image_tag(*args)
28
28
  if Cloudinary.config.enhance_image_tag
29
- cl_image_tag(*args)
29
+ source, options = args
30
+ cl_image_tag(source, {:type=>:asset}.merge(options || {}))
30
31
  else
31
32
  original_image_tag(*args)
32
33
  end
@@ -34,7 +35,8 @@ module CloudinaryHelper
34
35
 
35
36
  def image_path(*args)
36
37
  if Cloudinary.config.enhance_image_tag
37
- cl_image_path(*args)
38
+ source, options = args
39
+ cl_image_path(source, {:type=>:asset}.merge(options || {}))
38
40
  else
39
41
  original_image_path(*args)
40
42
  end
@@ -51,7 +51,7 @@ class Cloudinary::Utils
51
51
  private_cdn = options.delete(:private_cdn) || Cloudinary.config.private_cdn
52
52
  secure_distribution = options.delete(:secure_distribution) || Cloudinary.config.secure_distribution
53
53
 
54
- return source if :type.nil? && source.match(%r(^https?:/)i)
54
+ return source if (type.nil? || type == :asset) && source.match(%r(^https?:/)i)
55
55
  if source.start_with?("/")
56
56
  if source.start_with?("/images/")
57
57
  source = source.sub(%r(/images/), '')
@@ -67,6 +67,8 @@ class Cloudinary::Utils
67
67
  original_source = source
68
68
  source = @metadata["images/#{source}"]["public_id"]
69
69
  source += File.extname(original_source) if !format
70
+ elsif type == :asset
71
+ return source # requested asset, but no metadata - probably local file. return.
70
72
  end
71
73
 
72
74
  if cloud_name.start_with?("/")
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cloudinary
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nadav Soferman