hanko 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hanko/asset_url_helper.rb +8 -6
- data/lib/hanko/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d02cf787d3e42910046b22162ac3c795d19076ae
|
4
|
+
data.tar.gz: 6d9a548f1137b59a8b688041f1f7cae459244d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57c54d64277e78d1b0133d75030c53560ab3a0620f5f613d6ff063a573a12b465cdf7ca72a1293c4016a06d37ebcfaba6e7498ea3b5a2302cac81180467f59ee
|
7
|
+
data.tar.gz: 4c147de0779df13b4ddc49cd7cb2201acfba31ca1661b3f3da27ce17f8f4aa059694efca7b5ed709d9e3fc55693dc63b6dc1fb5ea6eb75bd9f4f14c23ed82720
|
@@ -1,21 +1,23 @@
|
|
1
1
|
module Hanko
|
2
2
|
module AssetUrlHelper
|
3
|
-
URI_REGEXP =
|
3
|
+
URI_REGEXP = %r{^(?:[-a-z]+://|cid:|data:|//)}i
|
4
4
|
|
5
5
|
def asset_path(source, options = {})
|
6
6
|
source = source.to_s
|
7
|
-
return ""
|
8
|
-
return source if
|
7
|
+
return "" if source.empty?
|
8
|
+
return source if URI_REGEXP === source
|
9
9
|
|
10
|
-
|
10
|
+
if index = source.index(/[?#]/)
|
11
|
+
source, tail = source[0, index], source[index..-1]
|
12
|
+
end
|
11
13
|
|
12
14
|
if extname = compute_asset_extname(source, options)
|
13
15
|
source = "#{source}#{extname}"
|
14
16
|
end
|
15
17
|
|
16
18
|
if source[0] != ?/
|
17
|
-
|
18
|
-
source = compute_asset_path(source, options
|
19
|
+
options[:fingerprint] = !tail
|
20
|
+
source = compute_asset_path(source, options)
|
19
21
|
end
|
20
22
|
|
21
23
|
relative_url_root = defined?(config.relative_url_root) && config.relative_url_root
|
data/lib/hanko/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanko
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tsukasaoishi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|