cloudinary 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cloudinary/helper.rb +4 -2
- data/lib/cloudinary/utils.rb +3 -1
- data/lib/cloudinary/version.rb +1 -1
- metadata +1 -1
data/lib/cloudinary/helper.rb
CHANGED
|
@@ -26,7 +26,8 @@ module CloudinaryHelper
|
|
|
26
26
|
|
|
27
27
|
def image_tag(*args)
|
|
28
28
|
if Cloudinary.config.enhance_image_tag
|
|
29
|
-
|
|
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
|
-
|
|
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
|
data/lib/cloudinary/utils.rb
CHANGED
|
@@ -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
|
|
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?("/")
|
data/lib/cloudinary/version.rb
CHANGED