asset_manifest 1.0.0.pre.rc2 → 1.0.0.pre.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asset_manifest.rb +3 -2
- data/lib/asset_manifest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0288edf09e8d73ad8319a36c6e04feb447951eb0
|
4
|
+
data.tar.gz: 06f4e71de159b6edc7140b4a374a7893de1d8442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a85497a49b8bd2ee0935abda14dfab3790de8998b7e1d469c2169ffabfb13eafdb50a28fb039d4e8f3303bbf0674e7228aa7289eb1edf63db7650c428adef858
|
7
|
+
data.tar.gz: 513b13dd58fb6cc72cd7a3726f58d8567a871c939f6197a52ed24a7f31b71720e4ea17415584b0c30f38b89e3edb3d160c95b5495f82f9efaecadf9eeb9b0d3c
|
data/lib/asset_manifest.rb
CHANGED
@@ -5,6 +5,7 @@ module AssetManifest
|
|
5
5
|
def initialize(manifest, asset_options = {})
|
6
6
|
@manifest = manifest
|
7
7
|
@asset_options = asset_options
|
8
|
+
@minify = asset_options.delete(:minify) { nil }
|
8
9
|
end
|
9
10
|
|
10
11
|
# Public: Generate a <link> tag.
|
@@ -32,7 +33,7 @@ module AssetManifest
|
|
32
33
|
# Returns a String.
|
33
34
|
def stylesheet_tag(path, html: {}, **opts)
|
34
35
|
html.update(rel: "stylesheet")
|
35
|
-
link_tag(path, html: html, **opts)
|
36
|
+
link_tag(path, html: html, **opts.merge(minify: @minify))
|
36
37
|
end
|
37
38
|
|
38
39
|
# Public: Generate a <script> tag to a JS file.
|
@@ -44,7 +45,7 @@ module AssetManifest
|
|
44
45
|
#
|
45
46
|
# Returns a String.
|
46
47
|
def script_tag(path, html: {}, **opts)
|
47
|
-
script = asset(path, opts)
|
48
|
+
script = asset(path, opts.merge(minify: @minify))
|
48
49
|
attrs = attributes(html)
|
49
50
|
attrs.concat(sri(script))
|
50
51
|
%Q(<script src="#{script.url}" #{attrs.join(" ")}></script>)
|